Prefer normal surface color over High surface color for navigation bars #167
This commit is contained in:
parent
d7fd67aeae
commit
6c08bfc9b1
|
@ -14,14 +14,16 @@ class BackgroundManager {
|
||||||
val colorHighest: Color
|
val colorHighest: Color
|
||||||
@Composable
|
@Composable
|
||||||
get() {
|
get() {
|
||||||
|
val surfaceContainer = MaterialTheme.colorScheme.surfaceContainer
|
||||||
val surfaceContainerHigh = MaterialTheme.colorScheme.surfaceContainerHigh
|
val surfaceContainerHigh = MaterialTheme.colorScheme.surfaceContainerHigh
|
||||||
val surfaceContainerHighest = MaterialTheme.colorScheme.surfaceContainerHighest
|
val surfaceContainerHighest = MaterialTheme.colorScheme.surfaceContainerHighest
|
||||||
|
|
||||||
var maxPriority = 0
|
var maxPriority = 0
|
||||||
surfaceColorsState.values.forEach { color ->
|
surfaceColorsState.values.forEach { color ->
|
||||||
val priority = when (color) {
|
val priority = when (color) {
|
||||||
surfaceContainerHigh -> 1
|
surfaceContainer -> 1
|
||||||
surfaceContainerHighest -> 2
|
surfaceContainerHigh -> 2
|
||||||
|
surfaceContainerHighest -> 3
|
||||||
else -> 0
|
else -> 0
|
||||||
}
|
}
|
||||||
if (maxPriority < priority) {
|
if (maxPriority < priority) {
|
||||||
|
@ -30,8 +32,9 @@ class BackgroundManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
return when (maxPriority) {
|
return when (maxPriority) {
|
||||||
0 -> surfaceContainerHigh
|
0 -> surfaceContainer
|
||||||
1 -> surfaceContainerHighest
|
1 -> surfaceContainerHigh
|
||||||
|
2 -> surfaceContainerHighest
|
||||||
else -> surfaceContainerHighest
|
else -> surfaceContainerHighest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue