pull/487/head^2
gedoor 4 years ago
parent 3f5ff5d6f9
commit b8522b8904
  1. 25
      app/src/main/java/io/legado/app/lib/theme/ATH.kt

@ -126,10 +126,8 @@ object ATH {
activity: Activity, activity: Activity,
color: Int = ThemeStore.navigationBarColor(activity) color: Int = ThemeStore.navigationBarColor(activity)
) { ) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { activity.window.navigationBarColor = color
activity.window.navigationBarColor = color setLightNavigationBar(activity, ColorUtils.isColorLight(color))
setLightNavigationBar(activity, ColorUtils.isColorLight(color))
}
} }
fun setLightNavigationBar(activity: Activity, enabled: Boolean) { fun setLightNavigationBar(activity: Activity, enabled: Boolean) {
@ -170,18 +168,15 @@ object ATH {
} }
fun setTaskDescriptionColor(activity: Activity, @ColorInt color: Int) { fun setTaskDescriptionColor(activity: Activity, @ColorInt color: Int) {
val color1: Int val color1: Int = ColorUtils.stripAlpha(color)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { @Suppress("DEPRECATION")
color1 = ColorUtils.stripAlpha(color) activity.setTaskDescription(
@Suppress("DEPRECATION") ActivityManager.TaskDescription(
activity.setTaskDescription( activity.title as String,
ActivityManager.TaskDescription( null,
activity.title as String, color1
null,
color1
)
) )
} )
} }
fun setTint( fun setTint(

Loading…
Cancel
Save