From 09ea207d1d9facb918866ac49d6d66c41d1ff845 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 8 Aug 2020 10:37:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/config/ThemeConfigFragment.kt | 12 +++++++++++- .../io/legado/app/ui/widget/prefs/ColorPreference.kt | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) 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 }