Cherish:move all theming stuffs to our Theme Settings
Signed-off-by: Hưng Phan <phandinhhungvp2001@gmail.com>
This commit is contained in:
@@ -528,5 +528,17 @@
|
||||
<string name="network_traffic_units_megabytes">Megabytes per second (MB/s)</string>
|
||||
<string name="network_traffic_hidearrow">Hide arrows</string>
|
||||
<string name="network_traffic_hidearrow_summary">Hide the network traffic indicator arrows</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 accent color. -->
|
||||
<string name="theme_customization_accent_color_title">Accent color</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>
|
||||
</resources>
|
||||
|
||||
@@ -17,5 +17,24 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/theme_title"
|
||||
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
|
||||
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/theme_customization_category">
|
||||
|
||||
<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" />
|
||||
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.font"
|
||||
android:title="@string/theme_customization_font_title"/>
|
||||
|
||||
<ListPreference
|
||||
android:key="android.theme.customization.icon_pack"
|
||||
android:title="@string/theme_customization_sysui_icon_title"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
|
||||
@@ -49,6 +49,9 @@ import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
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;
|
||||
@@ -93,6 +96,10 @@ public class ThemeSettings extends DashboardFragment implements OnPreferenceChan
|
||||
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.icon_pack"));
|
||||
return controllers;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user