SystemUiController - Android Ui color controller (status bar, navigation bar)
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 asActivity
.
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)
}