Refine layouts for large screen

- Support dynamic paddings depending on app's screen width
- Add round corners to homepage ripple effect to improve the transition
  of being highlighted
- Add an interface to support dynamic split layout for suggestion cards

Bug: 223300824
Test: robotest, manual
Change-Id: Iaca6b4fd3f7369179416ef084a800d7eb2ee4640
This commit is contained in:
Jason Chiu
2022-03-24 16:58:31 +08:00
parent c4c923d1eb
commit 680fce3acd
17 changed files with 441 additions and 98 deletions

View File

@@ -20,10 +20,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:minHeight="@dimen/homepage_preference_min_height"
android:gravity="center_vertical"
android:paddingStart="@dimen/homepage_menu_entry_padding_horizontal"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground"
android:clipToPadding="false"
android:baselineAligned="false">
@@ -32,11 +30,10 @@
android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="56dp"
android:gravity="center"
android:minWidth="48dp"
android:gravity="end|center_vertical"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingStart="@dimen/homepage_preference_icon_padding_start"
android:paddingTop="4dp"
android:paddingBottom="4dp">
@@ -44,18 +41,20 @@
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:maxWidth="40dp"
app:maxHeight="40dp"/>
app:maxWidth="48dp"
app:maxHeight="48dp"/>
</LinearLayout>
<RelativeLayout
android:id="@+id/text_frame"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingEnd="16dp">
android:paddingStart="@dimen/homepage_preference_text_padding_start"
android:paddingEnd="24dp">
<TextView
android:id="@android:id/title"
@@ -78,4 +77,4 @@
android:maxLines="4"
style="@style/PreferenceSummaryTextStyle"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>