增加一些基本的界面自定义功能

This commit is contained in:
HapeLee committed 2025-09-22 01:18:21 +08:00
1 parent 43b7b39ec6
commit 66b78f53af
16 files changed
+286 -297

No files matched your search

+29
View File
@@ -12,6 +12,35 @@
<item name="alertDialogTheme">@style/AppTheme.AlertDialog</item>
</style>
<style name="ThemeOverlay.WhiteBackground" parent="">
<item name="colorOnPrimary">@color/wh_theme_onPrimary</item>
<item name="colorOnSecondary">@color/wh_theme_onSecondary</item>
<item name="colorOnTertiary">@color/wh_theme_onTertiary</item>
<item name="colorOnTertiaryContainer">@color/wh_theme_onTertiaryContainer</item>
<item name="colorError">@color/wh_theme_error</item>
<item name="colorOnError">@color/wh_theme_onError</item>
<item name="colorErrorContainer">@color/wh_theme_errorContainer</item>
<item name="colorOnErrorContainer">@color/wh_theme_onErrorContainer</item>
<item name="android:colorBackground">@color/wh_theme_background</item>
<item name="colorOnBackground">@color/wh_theme_onBackground</item>
<item name="colorSurface">@color/wh_theme_surface</item>
<item name="colorOnSurface">@color/wh_theme_onSurface</item>
<item name="colorSurfaceVariant">@color/wh_theme_surfaceVariant</item>
<item name="colorOutlineVariant">@color/wh_theme_outlineVariant</item>
<item name="colorOnSurfaceInverse">@color/wh_theme_inverseOnSurface</item>
<item name="colorTertiaryFixed">@color/wh_theme_tertiaryFixed</item>
<item name="colorOnTertiaryFixed">@color/wh_theme_onTertiaryFixed</item>
<item name="colorTertiaryFixedDim">@color/wh_theme_tertiaryFixedDim</item>
<item name="colorOnTertiaryFixedVariant">@color/wh_theme_onTertiaryFixedVariant</item>
<item name="colorSurfaceDim">@color/wh_theme_surfaceDim</item>
<item name="colorSurfaceBright">@color/wh_theme_surfaceBright</item>
<item name="colorSurfaceContainerLowest">@color/wh_theme_surfaceContainerLowest</item>
<item name="colorSurfaceContainerLow">@color/wh_theme_surfaceContainerLow</item>
<item name="colorSurfaceContainer">@color/wh_theme_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/wh_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/wh_theme_surfaceContainerHighest</item>
</style>
<style name="ThemeOverlay.PureBlack" parent="">
<item name="android:colorBackground">@color/black</item>
<item name="colorSurface">@color/black</item>
+3 -3
View File
@@ -66,9 +66,9 @@
<color name="wh_theme_onError">#FFFFFF</color>
<color name="wh_theme_errorContainer">#FFDAD6</color>
<color name="wh_theme_onErrorContainer">#93000A</color>
<color name="wh_theme_background">#FCF8F8</color>
<color name="wh_theme_background">#FAFAFA</color>
<color name="wh_theme_onBackground">#1C1B1B</color>
<color name="wh_theme_surface">#FCF8F8</color>
<color name="wh_theme_surface">#F8F8F8</color>
<color name="wh_theme_onSurface">#1C1B1B</color>
<color name="wh_theme_surfaceVariant">#E0E3E3</color>
<color name="wh_theme_onSurfaceVariant">#444748</color>
@@ -91,7 +91,7 @@
<color name="wh_theme_tertiaryFixedDim">#CBC5C7</color>
<color name="wh_theme_onTertiaryFixedVariant">#494648</color>
<color name="wh_theme_surfaceDim">#DDD9D8</color>
<color name="wh_theme_surfaceBright">#FCF8F8</color>
<color name="wh_theme_surfaceBright">#F8F8F8</color>
<color name="wh_theme_surfaceContainerLowest">#FFFFFF</color>
<color name="wh_theme_surfaceContainerLow">#F7F3F2</color>
<color name="wh_theme_surfaceContainer">#F1EDEC</color>
+29
View File
@@ -11,6 +11,35 @@
<item name="alertDialogTheme">@style/AppTheme.AlertDialog</item>
</style>
<style name="ThemeOverlay.WhiteBackground" parent="">
<item name="colorOnPrimary">@color/wh_theme_onPrimary</item>
<item name="colorOnSecondary">@color/wh_theme_onSecondary</item>
<item name="colorOnTertiary">@color/wh_theme_onTertiary</item>
<item name="colorOnTertiaryContainer">@color/wh_theme_onTertiaryContainer</item>
<item name="colorError">@color/wh_theme_error</item>
<item name="colorOnError">@color/wh_theme_onError</item>
<item name="colorErrorContainer">@color/wh_theme_errorContainer</item>
<item name="colorOnErrorContainer">@color/wh_theme_onErrorContainer</item>
<item name="android:colorBackground">@color/wh_theme_background</item>
<item name="colorOnBackground">@color/wh_theme_onBackground</item>
<item name="colorSurface">@color/wh_theme_surface</item>
<item name="colorOnSurface">@color/wh_theme_onSurface</item>
<item name="colorSurfaceVariant">@color/wh_theme_surfaceVariant</item>
<item name="colorOutlineVariant">@color/wh_theme_outlineVariant</item>
<item name="colorOnSurfaceInverse">@color/wh_theme_inverseOnSurface</item>
<item name="colorTertiaryFixed">@color/wh_theme_tertiaryFixed</item>
<item name="colorOnTertiaryFixed">@color/wh_theme_onTertiaryFixed</item>
<item name="colorTertiaryFixedDim">@color/wh_theme_tertiaryFixedDim</item>
<item name="colorOnTertiaryFixedVariant">@color/wh_theme_onTertiaryFixedVariant</item>
<item name="colorSurfaceDim">@color/wh_theme_surfaceDim</item>
<item name="colorSurfaceBright">@color/wh_theme_surfaceBright</item>
<item name="colorSurfaceContainerLowest">@color/wh_theme_surfaceContainerLowest</item>
<item name="colorSurfaceContainerLow">@color/wh_theme_surfaceContainerLow</item>
<item name="colorSurfaceContainer">@color/wh_theme_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/wh_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/wh_theme_surfaceContainerHighest</item>
</style>
<style name="ThemeOverlay.PureBlack" parent="">
</style>
+25 -32
View File
@@ -33,7 +33,22 @@
<io.legato.kazusa.lib.prefs.SwitchPreference
android:defaultValue="false"
android:key="pure_black"
android:title="纯黑暗色模式" />
android:title="纯黑深色模式" />
<io.legato.kazusa.lib.prefs.ColorPreference
android:defaultValue="@color/md_green_500"
android:key="colorPrimary"
android:summary="使用种子颜色创建主题"
android:title="种子色"
app:cpv_dialogType="preset"
app:iconSpaceReserved="false" />
<io.legato.kazusa.lib.prefs.NameListPreference
android:defaultValue="global"
android:key="customMode"
android:title="自定义模式"
app:entries="@array/customMode"
app:entryValues="@array/customMode_value" />
<io.legato.kazusa.lib.prefs.IconListPreference
android:defaultValue="ic_launcher"
@@ -67,26 +82,26 @@
app:iconSpaceReserved="false" />
<io.legato.kazusa.lib.prefs.Preference
android:key="themeList"
android:summary="@string/theme_list_summary"
android:title="@string/theme_list"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
android:key="backgroundImage"
android:title="@string/background_image" />
</io.legato.kazusa.lib.prefs.PreferenceCategory>
<io.legato.kazusa.lib.prefs.PreferenceCategory
android:key="dayThemeCategory"
android:title="@string/day"
android:title="@string/share"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legato.kazusa.lib.prefs.Preference
android:key="backgroundImage"
android:title="@string/background_image" />
android:key="themeList"
android:summary="@string/theme_list_summary"
android:title="@string/theme_list"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
<io.legato.kazusa.lib.prefs.Preference
android:key="saveDayTheme"
@@ -98,26 +113,4 @@
</io.legato.kazusa.lib.prefs.PreferenceCategory>
<io.legato.kazusa.lib.prefs.PreferenceCategory
android:key="nightThemeCategory"
android:title="@string/night"
app:allowDividerAbove="true"
app:allowDividerBelow="false"
app:iconSpaceReserved="false"
app:layout="@layout/view_preference_category">
<io.legato.kazusa.lib.prefs.Preference
android:key="backgroundImageNight"
android:title="@string/background_image" />
<io.legato.kazusa.lib.prefs.Preference
android:key="saveNightTheme"
android:summary="@string/save_night_theme_summary"
android:title="@string/save_theme_config"
app:allowDividerAbove="false"
app:allowDividerBelow="false"
app:iconSpaceReserved="false" />
</io.legato.kazusa.lib.prefs.PreferenceCategory>
</androidx.preference.PreferenceScreen>