From 63a92ace48e8b30bebc2f63257b0a43621a96f8b Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 29 Mar 2020 09:51:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/ui/widget/prefs/PreferenceCategory.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt index 9b1436ba8..9cf6c2bfd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt @@ -8,6 +8,7 @@ import androidx.core.view.isVisible import androidx.preference.PreferenceCategory import androidx.preference.PreferenceViewHolder import io.legado.app.R +import io.legado.app.help.AppConfig import io.legado.app.lib.theme.ColorUtils import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.backgroundColor @@ -36,13 +37,18 @@ class PreferenceCategory(context: Context, attrs: AttributeSet) : PreferenceCate view.isVisible = title != null && title.isNotEmpty() val da = it.findViewById(R.id.preference_divider_above) + val dividerColor = if (AppConfig.isNightTheme) { + ColorUtils.shiftColor(context.backgroundColor, 1.05f) + } else { + ColorUtils.shiftColor(context.backgroundColor, 0.95f) + } if (da is View) { - da.setBackgroundColor(ColorUtils.darkenColor(context.backgroundColor)) + da.setBackgroundColor(dividerColor) da.isVisible = it.isDividerAllowedAbove } val db = it.findViewById(R.id.preference_divider_below) if (db is View) { - db.setBackgroundColor(ColorUtils.darkenColor(context.backgroundColor)) + db.setBackgroundColor(dividerColor) db.isVisible = it.isDividerAllowedBelow } }