Skip to content

Commit 4fdca84

Browse files
committed
(Bottom navigation) Using non-transparent background for the devices that cannot support liquid glass effect
1 parent 3db8d47 commit 4fdca84

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

composeApp/src/commonMain/kotlin/zed/rainxch/githubstore/app/navigation/BottomNavigation.kt

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,28 @@ fun BottomNavigation(
126126
modifier = Modifier
127127
.clip(CircleShape)
128128
.background(
129-
MaterialTheme.colorScheme.surfaceContainerHighest.copy(
130-
alpha = if (isDarkTheme) .25f else .15f
131-
)
132-
)
133-
.liquid(liquidState) {
134-
this.shape = CircleShape
135129
if (isLiquidFrostAvailable()) {
136-
this.frost = if (isDarkTheme) 12.dp else 10.dp
130+
MaterialTheme.colorScheme.surfaceContainerHighest.copy(
131+
alpha = if (isDarkTheme) .25f else .15f
132+
)
133+
} else {
134+
MaterialTheme.colorScheme.surfaceContainerHighest
137135
}
138-
this.curve = if (isDarkTheme) .35f else .45f
139-
this.refraction = if (isDarkTheme) .08f else .12f
140-
this.dispersion = if (isDarkTheme) .18f else .25f
141-
this.saturation = if (isDarkTheme) .40f else .55f
142-
this.contrast = if (isDarkTheme) 1.8f else 1.6f
143-
}
136+
)
137+
.then(
138+
if (isLiquidFrostAvailable()) {
139+
Modifier.liquid(liquidState) {
140+
this.shape = CircleShape
141+
if (isLiquidFrostAvailable()) {
142+
this.frost = if (isDarkTheme) 12.dp else 10.dp
143+
}
144+
this.curve = if (isDarkTheme) .35f else .45f
145+
this.refraction = if (isDarkTheme) .08f else .12f
146+
this.dispersion = if (isDarkTheme) .18f else .25f
147+
this.saturation = if (isDarkTheme) .40f else .55f
148+
this.contrast = if (isDarkTheme) 1.8f else 1.6f
149+
}
150+
} else Modifier)
144151
.pointerInput(Unit) { }
145152
) {
146153
val glassHighColor = if (isDarkTheme) {

0 commit comments

Comments
 (0)