Cherish: Add some native monet settings

Goal is to let users control monet engine more granularly
Generally all we can set solely by changing Settings.Secure.THEME_CUSTOMIZATION_OVERLAY_PACKAGES
Adds the ability to choose the accent color source, a custom accent color and the theme style
Theme styles are generally available with a preview on ThemePicker but not with custom sources nor color

Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
Ido Ben-Hur
2022-12-03 15:28:40 +02:00
committed by Hưng Phan
parent 95e5208d68
commit 327de60ac2
6 changed files with 315 additions and 1 deletions

View File

@@ -747,4 +747,42 @@
<item>7</item>
<item>8</item>
</string-array>
<!-- Monet theme styles -->
<string-array name="theme_style_entries">
<item>@string/theme_style_tonal_spot</item>
<item>@string/theme_style_vibrant</item>
<item>@string/theme_style_expressive</item>
<item>@string/theme_style_spritz</item>
<item>@string/theme_style_rainbow</item>
<item>@string/theme_style_fruit_salad</item>
<item>@string/theme_style_muted</item>
<item>@string/theme_style_content</item>
</string-array>
<string-array name="theme_style_values" translatable="false">
<item>TONAL_SPOT</item>
<item>VIBRANT</item>
<item>EXPRESSIVE</item>
<item>SPRITZ</item>
<item>RAINBOW</item>
<item>FRUIT_SALAD</item>
<item>MUTED</item>
<item>CONTENT</item>
</string-array>
<!-- Monet color sources -->
<string-array name="color_source_entries">
<item>@string/color_source_both</item>
<item>@string/color_source_home</item>
<item>@string/color_source_lock</item>
<item>@string/color_source_preset</item>
</string-array>
<string-array name="color_source_values" translatable="false">
<item>both</item>
<item>home_wallpaper</item>
<item>lock_wallpaper</item>
<item>preset</item>
</string-array>
</resources>

View File

@@ -876,4 +876,25 @@
<!-- Combined signal icons in status bar -->
<string name="combined_status_bar_signal_icons_title">Combined signal icons</string>
<string name="combined_status_bar_signal_icons_summary">Enable combined signal icons\n(WARNING: a soft reboot will occur upon enabling combined signal icons)</string>
<!-- Monet settings -->
<string name="monet_settings_title">Monet theming</string>
<string name="monet_settings_sammary">A few extra settings to customize monet engine</string>
<string name="theme_style_title">Theme style</string>
<string name="theme_style_tonal_spot">Tonal Spot (Default)</string>
<string name="theme_style_vibrant">Vibrant</string>
<string name="theme_style_expressive">Exspressive</string>
<string name="theme_style_spritz">Spritz</string>
<string name="theme_style_rainbow">Rainbow</string>
<string name="theme_style_fruit_salad">Fruit Salad</string>
<string name="theme_style_muted">Muted</string>
<string name="theme_style_content">Content</string>
<string name="color_source_title">Color source</string>
<string name="color_source_both">Both (Default)</string>
<string name="color_source_home">Home wallpaper</string>
<string name="color_source_lock">Lock wallpaper</string>
<string name="color_source_preset">Preset</string>
<string name="accent_color_title">Accent Color</string>
<string name="accent_color_summary">Override default accent color</string>
</resources>

View File

@@ -59,6 +59,13 @@
android:summary="@string/dark_ui_mode_summary"
android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment"
settings:controller="com.android.settings.display.DarkUIPreferenceController" />
<!-- Monet settings -->
<Preference
android:key="monet_settings"
android:title="@string/monet_settings_title"
android:summary="@string/monet_settings_sammary"
android:fragment="com.cherish.settings.fragments.MonetSettings" />
<Preference
android:key="android.theme.customization.lockscreen_clock_font"

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 Yet Another AOSP 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/monet_settings_title"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<ListPreference
android:key="theme_style"
android:title="@string/theme_style_title"
android:entries="@array/theme_style_entries"
android:entryValues="@array/theme_style_values"
android:defaultValue="0" />
<ListPreference
android:key="color_source"
android:title="@string/color_source_title"
android:entries="@array/color_source_entries"
android:entryValues="@array/color_source_values"
android:defaultValue="0" />
<net.margaritov.preference.colorpicker.ColorPickerPreference
android:key="accent_color"
android:title="@string/accent_color_title"
android:summary="@string/accent_color_summary" />
</PreferenceScreen>