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 4bcb6faf8..2a28a1b7f 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 @@ -85,42 +85,6 @@ class ThemeConfigFragment : BasePreferenceFragment(), } } } - findPreference(PreferKey.cAccent)?.let { - it.onSaveColor = { color -> - val background = - getPrefInt(PreferKey.cBackground, getCompatColor(R.color.md_grey_100)) - val textColor = getCompatColor(R.color.primaryText) - when { - ColorUtils.getColorDifference(color, background) <= 60 -> { - toastOnUi(R.string.accent_background_diff) - true - } - ColorUtils.getColorDifference(color, textColor) <= 60 -> { - toastOnUi(R.string.accent_text_diff) - true - } - else -> false - } - } - } - findPreference(PreferKey.cNAccent)?.let { - it.onSaveColor = { color -> - val background = - getPrefInt(PreferKey.cNBackground, getCompatColor(R.color.md_grey_900)) - val textColor = getCompatColor(R.color.primaryText) - when { - ColorUtils.getColorDifference(color, background) <= 60 -> { - toastOnUi(R.string.accent_background_diff) - true - } - ColorUtils.getColorDifference(color, textColor) <= 60 -> { - toastOnUi(R.string.accent_text_diff) - true - } - else -> false - } - } - } } override fun onViewCreated(view: View, savedInstanceState: Bundle?) {