adding a helper function for getting bottom tab bg color

This commit is contained in:
tibbi 2022-06-24 17:40:19 +02:00
parent 843a1f794f
commit ef65bd8747
2 changed files with 11 additions and 0 deletions

View file

@ -167,3 +167,13 @@ fun Context.toggleAppIconColor(appId: String, colorIndex: Int, color: Int, enabl
}
fun Context.getAppIconColors() = resources.getIntArray(R.array.md_app_icon_colors).toCollection(ArrayList())
fun Context.getBottomTabsBackgroundColor(): Int {
val baseColor = baseConfig.backgroundColor
val bottomColor = if (baseColor == Color.WHITE) {
resources.getColor(R.color.bottom_tabs_light_background)
} else {
baseConfig.backgroundColor.lightenColor(4)
}
return bottomColor
}

View file

@ -9,6 +9,7 @@
<color name="divider_grey">#88808080</color>
<color name="gradient_grey_start">#CC000000</color>
<color name="dark_grey">#FF333333</color>
<color name="bottom_tabs_light_background">#FFF1F1F1</color>
<color name="hint_white">#99FFFFFF</color>
<color name="hint_black">#66000000</color>