Skip to content

Commit

Permalink
Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Feb 22, 2025
1 parent 978ce29 commit ae328b1
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions libraries/base-ui/src/main/kotlin/catchup/base/ui/HazeScaffold.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import androidx.compose.ui.graphics.Color
import dev.chrisbanes.haze.HazeDefaults
import dev.chrisbanes.haze.HazeState
import dev.chrisbanes.haze.HazeStyle
import dev.chrisbanes.haze.haze
import dev.chrisbanes.haze.hazeChild
import dev.chrisbanes.haze.hazeEffect
import dev.chrisbanes.haze.hazeSource

@Composable
fun HazeScaffold(
Expand All @@ -39,11 +39,29 @@ fun HazeScaffold(
NestedScaffold(
modifier = modifier,
topBar = {
Box(modifier = Modifier.thenIf(blurTopBar) { hazeChild(hazeState) }, content = { topBar() })
Box(modifier = Modifier.thenIf(blurTopBar) {
hazeEffect(
hazeState, style =
HazeStyle(
tint = HazeDefaults.tint(containerColor),
blurRadius = HazeDefaults.blurRadius,
noiseFactor = HazeDefaults.noiseFactor,
)
)
}, content = { topBar() })
},
bottomBar = {
Box(
modifier = Modifier.thenIf(blurBottomBar) { hazeChild(hazeState) },
modifier = Modifier.thenIf(blurBottomBar) {
hazeEffect(
hazeState, style =
HazeStyle(
tint = HazeDefaults.tint(containerColor),
blurRadius = HazeDefaults.blurRadius,
noiseFactor = HazeDefaults.noiseFactor,
)
)
},
content = { bottomBar() },
)
},
Expand All @@ -56,14 +74,8 @@ fun HazeScaffold(
) { contentPadding ->
Box(
modifier =
Modifier.haze(
Modifier.hazeSource(
state = hazeState,
style =
HazeStyle(
HazeDefaults.tint(containerColor),
HazeDefaults.blurRadius,
HazeDefaults.noiseFactor,
),
),
content = { content(contentPadding) },
)
Expand Down

0 comments on commit ae328b1

Please sign in to comment.