setStatusBarColor

fun Activity.setStatusBarColor(@ColorRes colorRes: Int, lightBackground: Boolean = false)

Sets status bar color on the activity and optionally draws the status bar system ui in light or dark mode.

Parameters

colorRes

resource ID of the color to be set to the status bar.

lightBackground

whether to draw the status bar such that it is compatible with a light status bar background.