From 9b8ab05a179af3791e03a82036e47e331869b384 Mon Sep 17 00:00:00 2001 From: Brian Isganitis Date: Wed, 26 May 2021 19:13:11 -0400 Subject: [PATCH] Update preferences to Material Next styling Styles are forked from SettingsLib to avoid using any private APIs. Test: Settings root, all apps, and about have new style on S Bug: 187732263 Fix: 188254205, 188012913 Change-Id: I0ca55eecbc82cfa5d0b8707beb4bb7c82b2aa2b1 --- Android.bp | 1 + AndroidManifest-common.xml | 2 +- .../home_settings_switch_thumb_color.xml | 27 ++++++ .../home_settings_switch_track_color.xml | 28 ++++++ .../home_settings_switch_thumb.xml | 29 ++++++ .../home_settings_switch_track.xml | 26 +++++ res/layout-v31/settings_activity.xml | 69 ++++++++++++++ res/values-night-v31/colors.xml | 27 ++++++ res/values-v31/colors.xml | 9 ++ res/values-v31/config.xml | 20 ++++ res/values-v31/styles.xml | 95 +++++++++++++++++++ res/values/styles.xml | 10 +- 12 files changed, 337 insertions(+), 6 deletions(-) create mode 100644 res/color-v31/home_settings_switch_thumb_color.xml create mode 100644 res/color-v31/home_settings_switch_track_color.xml create mode 100644 res/drawable-v31/home_settings_switch_thumb.xml create mode 100644 res/drawable-v31/home_settings_switch_track.xml create mode 100644 res/layout-v31/settings_activity.xml create mode 100644 res/values-night-v31/colors.xml create mode 100644 res/values-v31/config.xml create mode 100644 res/values-v31/styles.xml diff --git a/Android.bp b/Android.bp index 1b6ffe42b7..45d022f4fd 100644 --- a/Android.bp +++ b/Android.bp @@ -112,6 +112,7 @@ android_library { "androidx.preference_preference", "androidx.slice_slice-view", "androidx.cardview_cardview", + "com.google.android.material_material", "iconloader_base", ], manifest: "AndroidManifest-common.xml", diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml index d725a16f80..4eecf29d67 100644 --- a/AndroidManifest-common.xml +++ b/AndroidManifest-common.xml @@ -144,7 +144,7 @@ diff --git a/res/color-v31/home_settings_switch_thumb_color.xml b/res/color-v31/home_settings_switch_thumb_color.xml new file mode 100644 index 0000000000..91d3d9b5e4 --- /dev/null +++ b/res/color-v31/home_settings_switch_thumb_color.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + diff --git a/res/color-v31/home_settings_switch_track_color.xml b/res/color-v31/home_settings_switch_track_color.xml new file mode 100644 index 0000000000..50784f527d --- /dev/null +++ b/res/color-v31/home_settings_switch_track_color.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + diff --git a/res/drawable-v31/home_settings_switch_thumb.xml b/res/drawable-v31/home_settings_switch_thumb.xml new file mode 100644 index 0000000000..260d5ea35f --- /dev/null +++ b/res/drawable-v31/home_settings_switch_thumb.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/res/drawable-v31/home_settings_switch_track.xml b/res/drawable-v31/home_settings_switch_track.xml new file mode 100644 index 0000000000..502a3007a9 --- /dev/null +++ b/res/drawable-v31/home_settings_switch_track.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/res/layout-v31/settings_activity.xml b/res/layout-v31/settings_activity.xml new file mode 100644 index 0000000000..59e14f22dd --- /dev/null +++ b/res/layout-v31/settings_activity.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values-night-v31/colors.xml b/res/values-night-v31/colors.xml new file mode 100644 index 0000000000..2c1bc90074 --- /dev/null +++ b/res/values-night-v31/colors.xml @@ -0,0 +1,27 @@ + + + + @android:color/system_accent1_100 + @android:color/system_neutral1_700 + @android:color/system_neutral1_900 + + @android:color/system_neutral2_300 + @android:color/system_accent2_700 + @android:color/system_neutral1_700 + \ No newline at end of file diff --git a/res/values-v31/colors.xml b/res/values-v31/colors.xml index 7b37001ade..53c6a35ff1 100644 --- a/res/values-v31/colors.xml +++ b/res/values-v31/colors.xml @@ -37,4 +37,13 @@ @android:color/system_neutral1_900 + @android:color/system_accent1_600 + @android:color/system_neutral1_100 + @android:color/system_neutral1_50 + + @android:color/system_accent1_100 + @android:color/system_accent2_100 + @android:color/system_neutral2_100 + @android:color/system_accent1_600 + @android:color/system_neutral2_600 diff --git a/res/values-v31/config.xml b/res/values-v31/config.xml new file mode 100644 index 0000000000..afb9e6d9e8 --- /dev/null +++ b/res/values-v31/config.xml @@ -0,0 +1,20 @@ + + + + false + false + \ No newline at end of file diff --git a/res/values-v31/styles.xml b/res/values-v31/styles.xml new file mode 100644 index 0000000000..0d2fce0307 --- /dev/null +++ b/res/values-v31/styles.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index 92824ad205..0f8169ef49 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -154,18 +154,18 @@ - -