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 = false) // set color only status bar
Activity.setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = false) // set color only navigation bar
Activity.setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = false) // 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 = false)
   setNavigationBarColor(@ColorInt color: Int, darkIcons: Boolean = false)
   setSystemBarsColor(@ColorInt color: Int, darkIcons: Boolean = false)
}

Happy Coding ?

GitHub

View Github