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 f29d17f
Show file tree
Hide file tree
Showing 2 changed files with 9 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
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ permalink: /changelog/
* [Gecko](https://github.com/mozilla-mobile/android-components/blob/main/buildSrc/src/main/java/Gecko.kt)
* [Configuration](https://github.com/mozilla-mobile/android-components/blob/main/.config.yml)

* **support-ktx**:
* The colors of the icons from the status bar should be in contrast with the status bar background color [#1795650](https://bugzilla.mozilla.org/show_bug.cgi?id=1795650)

# 107.0.0
* [Commits](https://github.com/mozilla-mobile/android-components/compare/v106.0.0..v107.0.0)
* [Milestone](https://github.com/mozilla-mobile/android-components/milestone/154?closed=1)
Expand Down

0 comments on commit f29d17f

Please sign in to comment.