|
|
@ -35,16 +35,16 @@ object ATH { |
|
|
|
) > since |
|
|
|
) > since |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setStatusbarColorAuto(activity: Activity, fullScreen: Boolean) { |
|
|
|
fun setStatusBarColorAuto(activity: Activity, fullScreen: Boolean) { |
|
|
|
val isTransparentStatusBar = activity.isTransparentStatusBar |
|
|
|
val isTransparentStatusBar = activity.isTransparentStatusBar |
|
|
|
setStatusbarColor( |
|
|
|
setStatusBarColor( |
|
|
|
activity, |
|
|
|
activity, |
|
|
|
ThemeStore.statusBarColor(activity, isTransparentStatusBar), |
|
|
|
ThemeStore.statusBarColor(activity, isTransparentStatusBar), |
|
|
|
isTransparentStatusBar, fullScreen |
|
|
|
isTransparentStatusBar, fullScreen |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setStatusbarColor( |
|
|
|
fun setStatusBarColor( |
|
|
|
activity: Activity, |
|
|
|
activity: Activity, |
|
|
|
color: Int, |
|
|
|
color: Int, |
|
|
|
isTransparentStatusBar: Boolean, |
|
|
|
isTransparentStatusBar: Boolean, |
|
|
@ -55,14 +55,14 @@ object ATH { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
activity.window.statusBarColor = color |
|
|
|
activity.window.statusBarColor = color |
|
|
|
} |
|
|
|
} |
|
|
|
setLightStatusbarAuto(activity, color) |
|
|
|
setLightStatusBarAuto(activity, color) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setLightStatusbarAuto(activity: Activity, bgColor: Int) { |
|
|
|
fun setLightStatusBarAuto(activity: Activity, bgColor: Int) { |
|
|
|
setLightStatusbar(activity, ColorUtils.isColorLight(bgColor)) |
|
|
|
setLightStatusBar(activity, ColorUtils.isColorLight(bgColor)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setLightStatusbar(activity: Activity, enabled: Boolean) { |
|
|
|
fun setLightStatusBar(activity: Activity, enabled: Boolean) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
|
|
val decorView = activity.window.decorView |
|
|
|
val decorView = activity.window.decorView |
|
|
|
val systemUiVisibility = decorView.systemUiVisibility |
|
|
|
val systemUiVisibility = decorView.systemUiVisibility |
|
|
@ -74,7 +74,7 @@ object ATH { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setLightNavigationbar(activity: Activity, enabled: Boolean) { |
|
|
|
fun setLightNavigationBar(activity: Activity, enabled: Boolean) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
|
|
|
val decorView = activity.window.decorView |
|
|
|
val decorView = activity.window.decorView |
|
|
|
var systemUiVisibility = decorView.systemUiVisibility |
|
|
|
var systemUiVisibility = decorView.systemUiVisibility |
|
|
@ -87,18 +87,18 @@ object ATH { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setLightNavigationbarAuto(activity: Activity, bgColor: Int) { |
|
|
|
fun setLightNavigationBarAuto(activity: Activity, bgColor: Int) { |
|
|
|
setLightNavigationbar(activity, ColorUtils.isColorLight(bgColor)) |
|
|
|
setLightNavigationBar(activity, ColorUtils.isColorLight(bgColor)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setNavigationbarColorAuto(activity: Activity) { |
|
|
|
fun setNavigationBarColorAuto(activity: Activity) { |
|
|
|
setNavigationbarColor(activity, ThemeStore.navigationBarColor(activity)) |
|
|
|
setNavigationBarColor(activity, ThemeStore.navigationBarColor(activity)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun setNavigationbarColor(activity: Activity, color: Int) { |
|
|
|
fun setNavigationBarColor(activity: Activity, color: Int) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
|
|
|
activity.window.navigationBarColor = color |
|
|
|
activity.window.navigationBarColor = color |
|
|
|
setLightNavigationbarAuto(activity, color) |
|
|
|
setLightNavigationBarAuto(activity, color) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|