Skip to content

Commit 1496030

Browse files
committed
fix: fix top bar color not changing on theme change
1 parent 47d1ed6 commit 1496030

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/homeScreen/AppHomeScreen.kt

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.nsh07.nsh07.ui.homeScreen
22

33
import androidx.compose.animation.*
4-
import androidx.compose.animation.core.FastOutLinearInEasing
54
import androidx.compose.foundation.layout.*
65
import androidx.compose.foundation.lazy.LazyColumn
76
import androidx.compose.foundation.lazy.rememberLazyListState
@@ -16,7 +15,6 @@ import androidx.compose.material3.TopAppBarDefaults.topAppBarColors
1615
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
1716
import androidx.compose.runtime.*
1817
import androidx.compose.ui.Modifier
19-
import androidx.compose.ui.graphics.lerp
2018
import androidx.compose.ui.input.nestedscroll.nestedScroll
2119
import androidx.compose.ui.platform.LocalLayoutDirection
2220
import androidx.compose.ui.platform.LocalUriHandler
@@ -155,17 +153,6 @@ fun AppHomeScreen(
155153
scrolledContainerColor = colorScheme.surface
156154
)
157155

158-
val targetColor by remember(scrollBehavior) {
159-
derivedStateOf {
160-
val overlappingFraction = scrollBehavior.state.overlappedFraction
161-
lerp(
162-
topAppBarColors.containerColor,
163-
topAppBarColors.scrolledContainerColor,
164-
FastOutLinearInEasing.transform(if (overlappingFraction > 0.01f) 1f else 0f),
165-
)
166-
}
167-
}
168-
169156
Scaffold(
170157
topBar = {
171158
AnimatedVisibility(
@@ -216,7 +203,7 @@ fun AppHomeScreen(
216203
.hazeEffect(
217204
hazeState,
218205
style = HazeStyle(
219-
backgroundColor = targetColor,
206+
backgroundColor = colorScheme.surface,
220207
tint = null,
221208
blurRadius = 20.dp,
222209
noiseFactor = 0f

composeApp/src/wasmJsMain/kotlin/org/nsh07/nsh07/ui/homeScreen/HomeScreenContent.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ fun LazyListScope.mainContent(
251251
style = typography.bodyMedium,
252252
color = colorScheme.outline
253253
)
254-
Text(".", style = typography.bodyMedium, color = colorScheme.outline)
255254
}
256255
Text(
257256
buildAnnotatedString {

0 commit comments

Comments
 (0)