diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index 97e1ed4ef..b6bc2a3e0 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -79,6 +79,16 @@ class ThemeConfigFragment : BasePreferenceFragment(), } } } + findPreference(PreferKey.cAccent)?.let { + it.onSaveColor = { color -> + false + } + } + findPreference(PreferKey.cNAccent)?.let { + it.onSaveColor = { color -> + false + } + } } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -182,7 +192,7 @@ class ThemeConfigFragment : BasePreferenceFragment(), } 3 -> { putPrefInt(PreferKey.cPrimary, getCompatColor(R.color.white)) - putPrefInt(PreferKey.cAccent, getCompatColor(R.color.black)) + putPrefInt(PreferKey.cAccent, getCompatColor(R.color.lightBlue_color)) putPrefInt(PreferKey.cBackground, getCompatColor(R.color.white)) putPrefInt(PreferKey.cBBackground, getCompatColor(R.color.white)) AppConfig.isNightTheme = false diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt index ec4176867..aae9c20b8 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt @@ -142,6 +142,7 @@ class ColorPreference(context: Context, attrs: AttributeSet) : Preference(contex } override fun onColorSelected(dialogId: Int, @ColorInt color: Int) { + //返回值为true时说明已经处理过,不再处理 if (onSaveColor?.invoke(color) == true) { return }