From b8522b89041869d16492f2f61a108c3f89a11fc8 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 19 Nov 2020 19:16:28 +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 --- .../main/java/io/legado/app/lib/theme/ATH.kt | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/io/legado/app/lib/theme/ATH.kt b/app/src/main/java/io/legado/app/lib/theme/ATH.kt index 87dd199c1..45e3fec18 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATH.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ATH.kt @@ -126,10 +126,8 @@ object ATH { activity: Activity, color: Int = ThemeStore.navigationBarColor(activity) ) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - activity.window.navigationBarColor = color - setLightNavigationBar(activity, ColorUtils.isColorLight(color)) - } + activity.window.navigationBarColor = color + setLightNavigationBar(activity, ColorUtils.isColorLight(color)) } fun setLightNavigationBar(activity: Activity, enabled: Boolean) { @@ -170,18 +168,15 @@ object ATH { } fun setTaskDescriptionColor(activity: Activity, @ColorInt color: Int) { - val color1: Int - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - color1 = ColorUtils.stripAlpha(color) - @Suppress("DEPRECATION") - activity.setTaskDescription( - ActivityManager.TaskDescription( - activity.title as String, - null, - color1 - ) + val color1: Int = ColorUtils.stripAlpha(color) + @Suppress("DEPRECATION") + activity.setTaskDescription( + ActivityManager.TaskDescription( + activity.title as String, + null, + color1 ) - } + ) } fun setTint(