Cherish:Move all themeing go Cherish Settings>Themes[2/2]
- Clock Styles - Signal and Wifi icon - Font - Packages icon - Status height Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
7
res/drawable/ic_package.xml
Normal file
7
res/drawable/ic_package.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L10.11,5.22L16,8.61L17.96,7.5L12,4.15M6.04,7.5L12,10.85L13.96,9.75L8.08,6.35L6.04,7.5M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z" />
|
||||
</vector>
|
||||
7
res/drawable/ic_shape.xml
Normal file
7
res/drawable/ic_shape.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M11,13.5V21.5H3V13.5H11M9,15.5H5V19.5H9V15.5M12,2L17.5,11H6.5L12,2M12,5.86L10.08,9H13.92L12,5.86M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13M17.5,15A2.5,2.5 0 0,0 15,17.5A2.5,2.5 0 0,0 17.5,20A2.5,2.5 0 0,0 20,17.5A2.5,2.5 0 0,0 17.5,15Z" />
|
||||
</vector>
|
||||
7
res/drawable/ic_signal.xml
Normal file
7
res/drawable/ic_signal.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000000" android:pathData="M3,21H6V18H3M8,21H11V14H8M13,21H16V9H13M18,21H21V3H18V21Z" />
|
||||
</vector>
|
||||
7
res/drawable/ic_size.xml
Normal file
7
res/drawable/ic_size.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="?android:attr/colorControlNormal" android:pathData="M9 7V17H15V15H11V7H9Z" />
|
||||
</vector>
|
||||
7
res/drawable/ic_wifi.xml
Normal file
7
res/drawable/ic_wifi.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:height="24dp"
|
||||
android:width="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path android:fillColor="#000000" android:pathData="M4,6V4H4.1C12.9,4 20,11.1 20,19.9V20H18V19.9C18,12.2 11.8,6 4,6M4,10V8A12,12 0 0,1 16,20H14A10,10 0 0,0 4,10M4,14V12A8,8 0 0,1 12,20H10A6,6 0 0,0 4,14M4,16A4,4 0 0,1 8,20H4V16Z" />
|
||||
</vector>
|
||||
@@ -1246,4 +1246,23 @@
|
||||
<string name="system_slider_style_memeround">Meme round</string>
|
||||
<string name="system_slider_style_memeroundstroke">Meme round stroke</string>
|
||||
<string name="system_slider_style_memestroke">Meme stroke</string>
|
||||
|
||||
<!-- Themeing -->
|
||||
<string name="dark_ui_mode_summary">Browse the dark theme options</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the settings category for theme overlays. -->
|
||||
<string name="theme_customization_category">Theming</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize headline and body fonts. -->
|
||||
<string name="theme_customization_font_title">Headline / Body font</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize the adaptive icon shape (e.g. launcher and quick settings icons). -->
|
||||
<string name="theme_customization_icon_shape_title">Icon shape</string>
|
||||
<!-- [CHAR_LIMIT=NONE] Developer Settings: Title of the setting which enables overlays to customize the statusbar icon -->
|
||||
<string name="theme_customization_sysui_icon_title">Statusbar icon</string>
|
||||
<!-- Clock style -->
|
||||
<string name="clock_style_title">Clock style</string>
|
||||
<string name="clock_style_summary">Customize lockscreen clock</string>
|
||||
<!-- Custom Signal bar icons -->
|
||||
<string name="custom_signal_bar_title">Signal</string>
|
||||
<!-- Custom Wi-Fi bar icons -->
|
||||
<string name="custom_wifi_bar_title">Wi-Fi</string>
|
||||
<string name="theme_customization_statusbar_height_title">Statusbar height</string>
|
||||
</resources>
|
||||
|
||||
@@ -19,10 +19,17 @@
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="system_theme_category"
|
||||
android:title="@string/theme_type_title">
|
||||
android:key="theme_customization_category"
|
||||
android:title="@string/theme_customization_category">
|
||||
|
||||
<net.margaritov.preference.colorpicker.ColorPickerPreference
|
||||
<Preference
|
||||
android:key="dark_ui_mode"
|
||||
android:title="@string/dark_ui_mode"
|
||||
android:summary="@string/dark_ui_mode_summary"
|
||||
android:fragment="com.android.settings.display.darkmode.DarkModeSettingsFragment"
|
||||
settings:controller="com.android.settings.display.DarkUIPreferenceController" />
|
||||
|
||||
<net.margaritov.preference.colorpicker.ColorPickerPreference
|
||||
android:key="accent_color"
|
||||
android:icon="@drawable/ic_accent_picker"
|
||||
android:title="@string/accent_color"
|
||||
@@ -38,6 +45,44 @@
|
||||
android:defaultValue="0xffffff"
|
||||
android:persistent="false" />
|
||||
|
||||
<Preference
|
||||
android:key="clock_style"
|
||||
android:title="@string/clock_style_title"
|
||||
android:icon="@drawable/ic_alarm"
|
||||
android:summary="@string/clock_style_summary">
|
||||
<intent
|
||||
android:action="android.intent.action.VIEW"
|
||||
android:targetPackage="com.android.wallpaper"
|
||||
android:targetClass="com.android.customization.picker.LockClockPickerActivity" />
|
||||
</Preference>
|
||||
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.signal_icon"
|
||||
android:icon="@drawable/ic_signal"
|
||||
android:title="@string/custom_signal_bar_title" />
|
||||
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.wifi_icon"
|
||||
android:icon="@drawable/ic_wifi"
|
||||
android:title="@string/custom_wifi_bar_title" />
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.adaptive_icon_shape"
|
||||
android:title="@string/theme_customization_icon_shape_title"
|
||||
android:icon="@drawable/ic_shape"/>
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.icon_pack.android"
|
||||
android:icon="@drawable/ic_package"
|
||||
android:title="@string/theme_customization_sysui_icon_title"/>
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.statusbar_height"
|
||||
android:icon="@drawable/ic_size"
|
||||
android:title="@string/theme_customization_statusbar_height_title"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:key="system_theme_category"
|
||||
android:title="@string/theme_type_title">
|
||||
|
||||
<ListPreference
|
||||
android:key="ui_style"
|
||||
android:title="@string/ui_style_title"
|
||||
|
||||
@@ -37,8 +37,12 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import android.provider.Settings;
|
||||
import com.android.settings.R;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.development.OverlayCategoryPreferenceController;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
import java.util.Locale;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
@@ -217,6 +221,30 @@ public class ThemeSettings extends SettingsPreferenceFragment implements
|
||||
return true;
|
||||
}
|
||||
|
||||
Override
|
||||
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
|
||||
return buildPreferenceControllers(context, getSettingsLifecycle(), this);
|
||||
}
|
||||
|
||||
private static List<AbstractPreferenceController> buildPreferenceControllers(
|
||||
Context context, Lifecycle lifecycle, Fragment fragment) {
|
||||
|
||||
final List<AbstractPreferenceController> 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();
|
||||
|
||||
Reference in New Issue
Block a user