jisungbin / SystemUiController

Android Ui color controller (status bar, navigation bar)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SystemUiController

Android system ui color controller (status bar, navigation bar)

Download

implementation "land.sungbin:systemuicontroller:${version}"

Usage

extensions

Activity.setStatusBarColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor()) // set color only status bar
Activity.setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor()) // set color only navigation bar
Activity.setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor()) // set color both statur bar and navigation bar

this extentions can be used for Fragment as well as Activity.

instance

Or, you can use an instance of SystemUiController directly.

class SystemUiController(private val window: Window) {
   setStatusBarColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor())
   setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor())
   setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = !color.isDarkColor())
}

Happy Coding :)

About

Android Ui color controller (status bar, navigation bar)

License:MIT License


Languages

Language:Kotlin 100.0%