@@ -107,16 +107,16 @@ fun UITest(
107107 val hazeState = remember { HazeState () }
108108
109109 val hazeStyleTopBar = HazeStyle (
110- backgroundColor = if (currentScrollBehavior.state.heightOffset > - 1 ) Color . Transparent else MiuixTheme .colorScheme.background,
110+ backgroundColor = MiuixTheme .colorScheme.background,
111111 tint = HazeTint (
112112 MiuixTheme .colorScheme.background.copy(
113- if (currentScrollBehavior.state.heightOffset > - 1 ) 1f
114- else lerp(1f , 0.67f , (currentScrollBehavior.state.heightOffset + 1 ) / - 143f )
113+ if (currentScrollBehavior.state.collapsedFraction <= 0f ) 1f
114+ else lerp(1f , 0.67f , (currentScrollBehavior.state.collapsedFraction) )
115115 )
116116 )
117117 )
118118
119- val hazeStyleBottomBar = HazeStyle (
119+ val hazeStyle = HazeStyle (
120120 backgroundColor = MiuixTheme .colorScheme.background,
121121 tint = HazeTint (MiuixTheme .colorScheme.background.copy(0.67f ))
122122 )
@@ -143,17 +143,15 @@ fun UITest(
143143 enter = fadeIn() + expandVertically(),
144144 exit = fadeOut() + shrinkVertically()
145145 ) {
146- BoxWithConstraints (
147- modifier = Modifier
148- .hazeEffect(hazeState) {
149- style = hazeStyleTopBar
150- blurRadius = 25 .dp
151- noiseFactor = 0f
152- }
153- ) {
146+ BoxWithConstraints {
154147 if (maxWidth > 840 .dp) {
155148 SmallTopAppBar (
156149 title = " Miuix" ,
150+ modifier = Modifier .hazeEffect(state = hazeState) {
151+ style = hazeStyle
152+ blurRadius = 25 .dp
153+ noiseFactor = 0f
154+ },
157155 scrollBehavior = currentScrollBehavior,
158156 color = Color .Transparent ,
159157 actions = {
@@ -205,6 +203,12 @@ fun UITest(
205203 } else {
206204 TopAppBar (
207205 title = " Miuix" ,
206+ modifier = Modifier
207+ .hazeEffect(state = hazeState) {
208+ style = hazeStyleTopBar
209+ blurRadius = 25 .dp
210+ noiseFactor = 0f
211+ },
208212 scrollBehavior = currentScrollBehavior,
209213 color = Color .Transparent ,
210214 actions = {
@@ -297,7 +301,7 @@ fun UITest(
297301 NavigationBar (
298302 modifier = Modifier
299303 .hazeEffect(hazeState) {
300- style = hazeStyleBottomBar
304+ style = hazeStyle
301305 blurRadius = 25 .dp
302306 noiseFactor = 0f
303307 },
0 commit comments