Skip to content

Commit 684fda0

Browse files
committed
fix(nav3): force light status bar icons in sheet popup window
Material3's ModalBottomSheet creates a separate popup window that defaults to dark (black) status bar icons, making them invisible against the dark scrim. Clear the APPEARANCE_LIGHT_STATUS_BARS flag on the popup's root view to force white icons. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 55c7310 commit 684fda0

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

ui/navigation/src/main/kotlin/com/getcode/navigation/scenes/ModalBottomSheetSceneStrategy.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import androidx.compose.material3.rememberModalBottomSheetState
1414
import androidx.compose.runtime.Composable
1515
import androidx.compose.runtime.CompositionLocalProvider
1616
import androidx.compose.runtime.LaunchedEffect
17+
import androidx.compose.runtime.SideEffect
1718
import androidx.compose.runtime.key
1819
import androidx.compose.runtime.rememberCoroutineScope
1920
import androidx.compose.runtime.staticCompositionLocalOf
2021
import androidx.compose.ui.Modifier
22+
import androidx.compose.ui.platform.LocalView
2123
import androidx.navigation3.runtime.NavEntry
2224
import androidx.navigation3.runtime.NavKey
2325
import androidx.navigation3.scene.OverlayScene
@@ -138,6 +140,15 @@ internal class ModalBottomSheetScene<T : Any> @OptIn(ExperimentalMaterial3Api::c
138140
contentWindowInsets = { WindowInsets() },
139141
containerColor = CodeTheme.colors.surface,
140142
) {
143+
// The sheet's popup window defaults to dark (black) status bar icons.
144+
// Force light icons so they're visible against the dark scrim.
145+
val view = LocalView.current
146+
SideEffect {
147+
view.rootView.windowInsetsController?.setSystemBarsAppearance(
148+
0, // clear light status bars flag → light (white) icons
149+
android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
150+
)
151+
}
141152
Box(
142153
modifier = Modifier
143154
.fillMaxWidth()

0 commit comments

Comments
 (0)