透明主题未要求设置背景问题 #158

This commit is contained in:
HapeLee
2025-10-28 00:43:07 +08:00
parent 85e5f9bc22
commit e1d581375a
3 changed files with 10 additions and 10 deletions
@@ -81,7 +81,7 @@ class ThemeCardPreference(context: Context, attrs: AttributeSet) : Preference(co
holder.card.setOnClickListener { holder.card.setOnClickListener {
if (value != currentValue) { if (value != currentValue) {
if (value == "12") { if (value == "13") {
val hasLightBg = !appCtx.getPrefString(PreferKey.bgImage).isNullOrEmpty() val hasLightBg = !appCtx.getPrefString(PreferKey.bgImage).isNullOrEmpty()
val hasDarkBg = !appCtx.getPrefString(PreferKey.bgImageN).isNullOrEmpty() val hasDarkBg = !appCtx.getPrefString(PreferKey.bgImageN).isNullOrEmpty()
if (!hasLightBg || !hasDarkBg) { if (!hasLightBg || !hasDarkBg) {
@@ -94,7 +94,7 @@ class ThemeCardPreference(context: Context, attrs: AttributeSet) : Preference(co
persistString(value) persistString(value)
callChangeListener(value) callChangeListener(value)
notifyDataSetChanged() notifyDataSetChanged()
val isDynamicSwitch = (oldValue == "11" || value == "11") val isDynamicSwitch = (oldValue == "12" || value == "12")
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
if (isDynamicSwitch) { if (isDynamicSwitch) {
context.alert(context.getString(R.string.restart_required_message)) { context.alert(context.getString(R.string.restart_required_message)) {
@@ -121,9 +121,9 @@ class ThemeConfigFragment : PreferenceFragmentCompat(),
val customMode = findPreference<NameListPreference>("customMode") val customMode = findPreference<NameListPreference>("customMode")
val currentTheme = getPrefString("app_theme") val currentTheme = getPrefString("app_theme")
colorPrimary?.isVisible = currentTheme == "11" colorPrimary?.isVisible = currentTheme == "12"
colorImage?.isVisible = currentTheme == "11" colorImage?.isVisible = currentTheme == "12"
customMode?.isVisible = currentTheme == "11" customMode?.isVisible = currentTheme == "12"
themePref?.let { themePref?.let {
it.setOnPreferenceChangeListener { _, _ -> it.setOnPreferenceChangeListener { _, _ ->
@@ -132,9 +132,9 @@ class ThemeConfigFragment : PreferenceFragmentCompat(),
} }
themePref?.setOnPreferenceChangeListener { _, newValue -> themePref?.setOnPreferenceChangeListener { _, newValue ->
colorPrimary?.isVisible = newValue == "11" colorPrimary?.isVisible = newValue == "12"
colorImage?.isVisible = currentTheme == "11" colorImage?.isVisible = currentTheme == "12"
customMode?.isVisible = newValue == "11" customMode?.isVisible = newValue == "12"
true true
} }
+2 -2
View File
@@ -1,4 +1,4 @@
VERSION_MAJOR=3 VERSION_MAJOR=3
VERSION_MINOR=25 VERSION_MINOR=26
VERSION_PATCH=15 VERSION_PATCH=1
VERSION_SUFFIX= VERSION_SUFFIX=