Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
For #1795650 The colors of the icons from the status bar should be in…
Browse files Browse the repository at this point in the history
… contrast with the status bar background color.
  • Loading branch information
iorgamgabriel committed Oct 18, 2022
1 parent 2d5d1ef commit c47253d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ import mozilla.components.support.utils.ColorUtils.isDark
* Colors the status bar.
* If the color is light enough, a light status bar with dark icons will be used.
*/
fun Window.setStatusBarTheme(@ColorInt color: Int) {
fun Window.setStatusBarTheme(@ColorInt toolbarColor: Int) {
getWindowInsetsController().isAppearanceLightStatusBars =
isDark(color)
statusBarColor = color
!isDark(toolbarColor)
statusBarColor = toolbarColor
}

/**
* Colors the navigation bar.
* If the color is light enough, a light navigation bar with dark icons will be used.
*/
fun Window.setNavigationBarTheme(@ColorInt color: Int) {
fun Window.setNavigationBarTheme(@ColorInt toolbarColor: Int) {
getWindowInsetsController().isAppearanceLightNavigationBars =
isDark(color)
!isDark(toolbarColor)

if (SDK_INT >= Build.VERSION_CODES.P) {
navigationBarDividerColor = 0
}
navigationBarColor = color
navigationBarColor = toolbarColor
}

/**
Expand Down

0 comments on commit c47253d

Please sign in to comment.