pull/298/head^2
gedoor 4 years ago
parent a6f15f9e6f
commit 09ea207d1d
  1. 12
      app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt
  2. 1
      app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt

@ -79,6 +79,16 @@ class ThemeConfigFragment : BasePreferenceFragment(),
} }
} }
} }
findPreference<ColorPreference>(PreferKey.cAccent)?.let {
it.onSaveColor = { color ->
false
}
}
findPreference<ColorPreference>(PreferKey.cNAccent)?.let {
it.onSaveColor = { color ->
false
}
}
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@ -182,7 +192,7 @@ class ThemeConfigFragment : BasePreferenceFragment(),
} }
3 -> { 3 -> {
putPrefInt(PreferKey.cPrimary, getCompatColor(R.color.white)) 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.cBackground, getCompatColor(R.color.white))
putPrefInt(PreferKey.cBBackground, getCompatColor(R.color.white)) putPrefInt(PreferKey.cBBackground, getCompatColor(R.color.white))
AppConfig.isNightTheme = false AppConfig.isNightTheme = false

@ -142,6 +142,7 @@ class ColorPreference(context: Context, attrs: AttributeSet) : Preference(contex
} }
override fun onColorSelected(dialogId: Int, @ColorInt color: Int) { override fun onColorSelected(dialogId: Int, @ColorInt color: Int) {
//返回值为true时说明已经处理过,不再处理
if (onSaveColor?.invoke(color) == true) { if (onSaveColor?.invoke(color) == true) {
return return
} }

Loading…
Cancel
Save