Merge "Apply material 3 to fill dialog/save ui" into tm-dev am: 79c786ba8f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18185753

Change-Id: Id3d68c9b18909e5312d9d0be4dbf1d71b74668d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Joanne Chung
2022-05-18 21:29:22 +00:00
committed by Automerger Merge Worker
9 changed files with 130 additions and 28 deletions

View File

@@ -16,7 +16,7 @@
<shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android"> <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
<corners <corners
android:topLeftRadius="@dimen/config_bottomDialogCornerRadius" android:topLeftRadius="@dimen/autofill_dialog_corner_radius"
android:topRightRadius="@dimen/config_bottomDialogCornerRadius"/> android:topRightRadius="@dimen/autofill_dialog_corner_radius"/>
<solid android:color="?attr/colorBackground" /> <solid android:color="?attr/colorSurface" />
</shape> </shape>

View File

@@ -0,0 +1,20 @@
<!-- Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/selectableItemBackground"/>
<stroke android:width="1dp" android:color="?attr/colorAccentPrimaryVariant"/>
<corners android:radius="28dp"/>
</shape>

View File

@@ -0,0 +1,19 @@
<!-- Copyright (C) 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/colorAccentPrimary"/>
<corners android:radius="28dp"/>
</shape>

View File

@@ -20,8 +20,6 @@
android:id="@+id/autofill_dialog_picker" android:id="@+id/autofill_dialog_picker"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" 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:background="@drawable/bottomsheet_background"
android:orientation="vertical"> android:orientation="vertical">
@@ -29,8 +27,9 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:paddingStart="@dimen/autofill_save_inner_padding" android:paddingTop="24dp"
android:paddingEnd="@dimen/autofill_save_inner_padding" android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
@@ -59,6 +58,8 @@
android:paddingStart="@dimen/autofill_save_inner_padding" android:paddingStart="@dimen/autofill_save_inner_padding"
android:paddingEnd="@dimen/autofill_save_inner_padding" android:paddingEnd="@dimen/autofill_save_inner_padding"
android:visibility="gone" android:visibility="gone"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:background="@drawable/autofill_dataset_picker_background"/> android:background="@drawable/autofill_dataset_picker_background"/>
<ListView <ListView
@@ -69,22 +70,30 @@
android:drawSelectorOnTop="true" android:drawSelectorOnTop="true"
android:clickable="true" android:clickable="true"
android:divider="?android:attr/listDivider" android:divider="?android:attr/listDivider"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:background="@drawable/autofill_dataset_picker_background" android:background="@drawable/autofill_dataset_picker_background"
android:visibility="gone"/> android:visibility="gone"/>
<com.android.internal.widget.ButtonBarLayout <com.android.internal.widget.ButtonBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_gravity="end" android:layout_gravity="end"
android:padding="@dimen/autofill_save_button_bar_padding"
android:clipToPadding="false" android:clipToPadding="false"
android:layout_marginTop="32dp"
android:layout_marginBottom="18dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:theme="@style/Theme.DeviceDefault.AutofillHalfScreenDialogButton"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:id="@+id/autofill_dialog_no" android:id="@+id/autofill_dialog_no"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="36dp"
style="?android:attr/buttonBarButtonStyle" android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
style="@style/AutofillHalfSheetOutlinedButton"
android:text="@string/autofill_save_no"> android:text="@string/autofill_save_no">
</Button> </Button>
@@ -98,8 +107,10 @@
<Button <Button
android:id="@+id/autofill_dialog_yes" android:id="@+id/autofill_dialog_yes"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="36dp"
style="@style/Widget.DeviceDefault.Button.Colored" android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
style="@style/AutofillHalfSheetTonalButton"
android:text="@string/autofill_save_yes" android:text="@string/autofill_save_yes"
android:visibility="gone" > android:visibility="gone" >
</Button> </Button>

View File

@@ -19,6 +19,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bottomsheet_background"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@@ -29,7 +30,7 @@
android:layout_marginTop="@dimen/autofill_save_outer_top_margin" android:layout_marginTop="@dimen/autofill_save_outer_top_margin"
android:paddingTop="@dimen/autofill_save_outer_top_padding" android:paddingTop="@dimen/autofill_save_outer_top_padding"
android:elevation="@dimen/autofill_elevation" android:elevation="@dimen/autofill_elevation"
android:background="?android:attr/colorBackground" android:background="?android:attr/colorSurface"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@@ -73,13 +74,26 @@
<com.android.internal.widget.ButtonBarLayout <com.android.internal.widget.ButtonBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_gravity="end" android:layout_gravity="end"
android:padding="@dimen/autofill_save_button_bar_padding"
android:clipToPadding="false" android:clipToPadding="false"
android:layout_weight="1" android:layout_marginTop="32dp"
android:layout_marginBottom="18dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:theme="@style/Theme.DeviceDefault.AutofillHalfScreenDialogButton"
android:orientation="horizontal"> android:orientation="horizontal">
<Button
android:id="@+id/autofill_save_no"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
style="@style/AutofillHalfSheetOutlinedButton"
android:text="@string/autofill_save_no">
</Button>
<Space <Space
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
@@ -87,19 +101,13 @@
android:visibility="invisible"> android:visibility="invisible">
</Space> </Space>
<Button
android:id="@+id/autofill_save_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonBarButtonStyle"
android:text="@string/autofill_save_no">
</Button>
<Button <Button
android:id="@+id/autofill_save_yes" android:id="@+id/autofill_save_yes"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="36dp"
style="@style/Widget.DeviceDefault.Button.Colored" android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
style="@style/AutofillHalfSheetTonalButton"
android:text="@string/autofill_save_yes"> android:text="@string/autofill_save_yes">
</Button> </Button>

View File

@@ -90,4 +90,13 @@ easier.
<item name="colorBackgroundFloating">@android:color/GM2_grey_800</item> <item name="colorBackgroundFloating">@android:color/GM2_grey_800</item>
<item name="textColorSecondary">@android:color/resolver_text_color_secondary_dark</item> <item name="textColorSecondary">@android:color/resolver_text_color_secondary_dark</item>
</style> </style>
<!-- @hide DeviceDefault theme for the Autofill half screen dialog UI. -->
<style name="Theme.DeviceDefault.AutofillHalfScreenDialogButton" parent="Theme.DeviceDefault.Panel">
<item name="selectableItemBackground">@android:color/transparent</item>
<item name="colorAccentPrimaryVariant">@color/system_accent1_200</item>
<item name="colorAccentPrimary">@color/system_accent1_700</item>
<item name="textColorPrimary">@color/system_neutral1_100</item>
<item name="textColorSecondary">@color/system_neutral2_100</item>
</style>
</resources> </resources>

View File

@@ -873,6 +873,7 @@
<dimen name="autofill_save_title_start_padding">8dp</dimen> <dimen name="autofill_save_title_start_padding">8dp</dimen>
<dimen name="autofill_save_scroll_view_top_margin">4dp</dimen> <dimen name="autofill_save_scroll_view_top_margin">4dp</dimen>
<dimen name="autofill_save_button_bar_padding">16dp</dimen> <dimen name="autofill_save_button_bar_padding">16dp</dimen>
<dimen name="autofill_dialog_corner_radius">28dp</dimen>
<!-- Max height of the the autofill save custom subtitle as a fraction of the screen width/height --> <!-- Max height of the the autofill save custom subtitle as a fraction of the screen width/height -->
<dimen name="autofill_save_custom_subtitle_max_height">20%</dimen> <dimen name="autofill_save_custom_subtitle_max_height">20%</dimen>
@@ -888,7 +889,7 @@
<integer name="autofill_max_visible_datasets">3</integer> <integer name="autofill_max_visible_datasets">3</integer>
<!-- Size of an icon in the Autolfill fill dialog --> <!-- Size of an icon in the Autolfill fill dialog -->
<dimen name="autofill_dialog_icon_size">24dp</dimen> <dimen name="autofill_dialog_icon_size">32dp</dimen>
<!-- Size of a slice shortcut view --> <!-- Size of a slice shortcut view -->
<dimen name="slice_shortcut_size">56dp</dimen> <dimen name="slice_shortcut_size">56dp</dimen>

View File

@@ -1464,6 +1464,31 @@ please see styles_device_defaults.xml.
<item name="successColor">@color/lock_pattern_view_success_color</item> <item name="successColor">@color/lock_pattern_view_success_color</item>
</style> </style>
<!-- @hide The style for Autofill half screen dialog button -->
<style name="AutofillHalfSheetButton" parent="Widget.Material.Button">
<item name="textSize">14sp</item>
<item name="fontFamily">google-sans-text-medium</item>
<item name="textStyle">normal</item>
<item name="textAllCaps">false</item>
<item name="layout_marginTop">6dp</item>
<item name="layout_marginBottom">6dp</item>
<item name="paddingStart">16dp</item>
<item name="paddingEnd">16dp</item>
<item name="paddingTop">8dp</item>
<item name="paddingBottom">8dp</item>
</style>
<!-- @hide Tonal button for Autofill half screen dialog -->
<style name="AutofillHalfSheetTonalButton" parent="AutofillHalfSheetButton">
<item name="textColor">?attr/textColorPrimary</item>
<item name="background">@drawable/btn_tonal</item>
<item name="stateListAnimator">@null</item>
</style>
<!-- @hide Outline button for Autofill half screen dialog -->
<style name="AutofillHalfSheetOutlinedButton" parent="AutofillHalfSheetButton">
<item name="textColor">?attr/textColorPrimary</item>
<item name="background">@drawable/btn_outlined</item>
</style>
<!-- @hide Autofill background for popup window (not for fullscreen) --> <!-- @hide Autofill background for popup window (not for fullscreen) -->
<style name="AutofillDatasetPicker"> <style name="AutofillDatasetPicker">
<item name="elevation">4dp</item> <item name="elevation">4dp</item>

View File

@@ -2695,4 +2695,13 @@ easier.
<style name="Theme.DeviceDefault.DocumentsUI" parent="Theme.DeviceDefault.DayNight"> <style name="Theme.DeviceDefault.DocumentsUI" parent="Theme.DeviceDefault.DayNight">
<item name="actionModeCloseDrawable">@drawable/ic_clear_material</item> <item name="actionModeCloseDrawable">@drawable/ic_clear_material</item>
</style> </style>
<!-- @hide DeviceDefault theme for the Autofill half screen dialog UI. -->
<style name="Theme.DeviceDefault.AutofillHalfScreenDialogButton" parent="Theme.DeviceDefault.Panel">
<item name="selectableItemBackground">@android:color/transparent</item>
<item name="colorAccentPrimaryVariant">@color/system_accent1_600</item>
<item name="colorAccentPrimary">@color/system_accent1_100</item>
<item name="textColorPrimary">@color/system_neutral1_900</item>
<item name="textColorSecondary">@color/system_neutral2_700</item>
</style>
</resources> </resources>