From 7d257332b82b461528d69e05565adfaab9327483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C6=B0ng=20Phan?= Date: Sun, 25 Jul 2021 12:30:05 +0700 Subject: [PATCH] Cherish:Move all themeing go Cherish Settings>Themes[2/2] - Clock Styles - Signal and Wifi icon - Font - Packages icon - Status height MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hưng Phan --- res/drawable/ic_package.xml | 7 +++ res/drawable/ic_shape.xml | 7 +++ res/drawable/ic_signal.xml | 7 +++ res/drawable/ic_size.xml | 7 +++ res/drawable/ic_wifi.xml | 7 +++ res/values/cherish_strings.xml | 19 +++++++ res/xml/cherish_settings_theme.xml | 51 +++++++++++++++++-- .../settings/fragments/ThemeSettings.java | 28 ++++++++++ 8 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 res/drawable/ic_package.xml create mode 100644 res/drawable/ic_shape.xml create mode 100644 res/drawable/ic_signal.xml create mode 100644 res/drawable/ic_size.xml create mode 100644 res/drawable/ic_wifi.xml diff --git a/res/drawable/ic_package.xml b/res/drawable/ic_package.xml new file mode 100644 index 0000000..c44a701 --- /dev/null +++ b/res/drawable/ic_package.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/res/drawable/ic_shape.xml b/res/drawable/ic_shape.xml new file mode 100644 index 0000000..7dcbd44 --- /dev/null +++ b/res/drawable/ic_shape.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/res/drawable/ic_signal.xml b/res/drawable/ic_signal.xml new file mode 100644 index 0000000..fcffb0d --- /dev/null +++ b/res/drawable/ic_signal.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/res/drawable/ic_size.xml b/res/drawable/ic_size.xml new file mode 100644 index 0000000..b2d3a0e --- /dev/null +++ b/res/drawable/ic_size.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/res/drawable/ic_wifi.xml b/res/drawable/ic_wifi.xml new file mode 100644 index 0000000..b742ee7 --- /dev/null +++ b/res/drawable/ic_wifi.xml @@ -0,0 +1,7 @@ + + + \ No newline at end of file diff --git a/res/values/cherish_strings.xml b/res/values/cherish_strings.xml index 05f5613..b08091c 100644 --- a/res/values/cherish_strings.xml +++ b/res/values/cherish_strings.xml @@ -1246,4 +1246,23 @@ Meme round Meme round stroke Meme stroke + + + Browse the dark theme options + + Theming + + Headline / Body font + + Icon shape + + Statusbar icon + + Clock style + Customize lockscreen clock + + Signal + + Wi-Fi + Statusbar height diff --git a/res/xml/cherish_settings_theme.xml b/res/xml/cherish_settings_theme.xml index f44abba..854b09e 100644 --- a/res/xml/cherish_settings_theme.xml +++ b/res/xml/cherish_settings_theme.xml @@ -19,10 +19,17 @@ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"> + android:key="theme_customization_category" + android:title="@string/theme_customization_category"> - + + + + + + + + + + + + + + + + createPreferenceControllers(Context context) { + return buildPreferenceControllers(context, getSettingsLifecycle(), this); + } + + private static List buildPreferenceControllers( + Context context, Lifecycle lifecycle, Fragment fragment) { + + final List controllers = new ArrayList<>(); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.font")); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.adaptive_icon_shape")); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.icon_pack.android")); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.statusbar_height")); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.signal_icon")); + controllers.add(new OverlayCategoryPreferenceController(context, + "android.theme.customization.wifi_icon")); + return controllers; + } + @Override public boolean onPreferenceChange(Preference preference, Object objValue) { ContentResolver resolver = getActivity().getContentResolver();