From 4976f2c110142ad1370484786edd6135bd32a44c Mon Sep 17 00:00:00 2001 From: Joanne Chung Date: Fri, 6 May 2022 12:53:12 +0800 Subject: [PATCH] Apply material 3 to fill dialog/save ui The framework cannot use the material 3 directly because it may cause conflicts with libraries used by apps. So we tried to do the customization to let it looks like matrial 3. This is the first change for updating the style, it focuses on the color and buttons, we still have some UIs don't respect the spec, this will be done in the follow up change. Bug: 225234267 Test: use sample code to verify the fill dialog and saveui. The color and shape are expected in light/dark/theme color. Change-Id: Ibfa108b8812c5b0ea7987882451cfcd62579e5e4 --- .../res/drawable/bottomsheet_background.xml | 6 ++-- core/res/res/drawable/btn_outlined.xml | 20 +++++++++++ core/res/res/drawable/btn_tonal.xml | 19 ++++++++++ core/res/res/layout/autofill_fill_dialog.xml | 31 ++++++++++------ core/res/res/layout/autofill_save.xml | 36 +++++++++++-------- .../values-night/themes_device_defaults.xml | 9 +++++ core/res/res/values/dimens.xml | 3 +- core/res/res/values/styles.xml | 25 +++++++++++++ .../res/res/values/themes_device_defaults.xml | 9 +++++ 9 files changed, 130 insertions(+), 28 deletions(-) create mode 100644 core/res/res/drawable/btn_outlined.xml create mode 100644 core/res/res/drawable/btn_tonal.xml diff --git a/core/res/res/drawable/bottomsheet_background.xml b/core/res/res/drawable/bottomsheet_background.xml index 00d53004c9dca..9469e0a672076 100644 --- a/core/res/res/drawable/bottomsheet_background.xml +++ b/core/res/res/drawable/bottomsheet_background.xml @@ -16,7 +16,7 @@ - + android:topLeftRadius="@dimen/autofill_dialog_corner_radius" + android:topRightRadius="@dimen/autofill_dialog_corner_radius"/> + diff --git a/core/res/res/drawable/btn_outlined.xml b/core/res/res/drawable/btn_outlined.xml new file mode 100644 index 0000000000000..8fbcc258be551 --- /dev/null +++ b/core/res/res/drawable/btn_outlined.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/core/res/res/drawable/btn_tonal.xml b/core/res/res/drawable/btn_tonal.xml new file mode 100644 index 0000000000000..b891ca8cd7889 --- /dev/null +++ b/core/res/res/drawable/btn_tonal.xml @@ -0,0 +1,19 @@ + + + + + diff --git a/core/res/res/layout/autofill_fill_dialog.xml b/core/res/res/layout/autofill_fill_dialog.xml index 0b6a2016f03d1..e638764840738 100644 --- a/core/res/res/layout/autofill_fill_dialog.xml +++ b/core/res/res/layout/autofill_fill_dialog.xml @@ -20,8 +20,6 @@ android:id="@+id/autofill_dialog_picker" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/autofill_save_outer_top_margin" - android:padding="@dimen/autofill_save_outer_top_padding" android:background="@drawable/bottomsheet_background" android:orientation="vertical"> @@ -29,8 +27,9 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:paddingStart="@dimen/autofill_save_inner_padding" - android:paddingEnd="@dimen/autofill_save_inner_padding" + android:paddingTop="24dp" + android:layout_marginStart="24dp" + android:layout_marginEnd="24dp" android:orientation="vertical"> @@ -98,8 +107,10 @@ diff --git a/core/res/res/layout/autofill_save.xml b/core/res/res/layout/autofill_save.xml index eb5fd56d51c6c..8a1a9c7a90832 100644 --- a/core/res/res/layout/autofill_save.xml +++ b/core/res/res/layout/autofill_save.xml @@ -19,6 +19,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" + android:background="@drawable/bottomsheet_background" android:orientation="vertical"> + + - - diff --git a/core/res/res/values-night/themes_device_defaults.xml b/core/res/res/values-night/themes_device_defaults.xml index 93975a9d7bf18..366e6f97eed33 100644 --- a/core/res/res/values-night/themes_device_defaults.xml +++ b/core/res/res/values-night/themes_device_defaults.xml @@ -90,4 +90,13 @@ easier. @android:color/GM2_grey_800 @android:color/resolver_text_color_secondary_dark + + + diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index b73f96e3696ca..211bf7f7b581d 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -873,6 +873,7 @@ 8dp 4dp 16dp + 28dp 20% @@ -888,7 +889,7 @@ 3 - 24dp + 32dp 56dp diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index c07404bf141d7..0c35f93147a64 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1464,6 +1464,31 @@ please see styles_device_defaults.xml. @color/lock_pattern_view_success_color + + + + + + + + + +