ã¯ããã«
Android Jetpack Composeã§ModalBottomSheet
ã使ç¨ããéãã¹ãã¼ã¿ã¹ãã¼ã®è²ãå¤æ´ããããã¨ãããã
â»ã¹ãã¼ã¿ã¹ãã¼ã¨ã¯ãç»é¢ä¸é¨ã«è¡¨ç¤ºãããã¢ã¤ã³ã³(æå»ã»ããããªã¼æ®éãªã©)ã並ãã é åã®ãã¨ã
åå
ModalBottomSheet
ã¡ã½ããå
ã§isAppearanceLightStatusBars
ã®å¤ãå¤æ´ãã¦ããã®ãåå ã
WindowCompat.getInsetsController(window, window.decorView).apply { isAppearanceLightStatusBars = !darkThemeEnabled isAppearanceLightNavigationBars = !darkThemeEnabled }
â»androidx.compose.material3:material3-android:1.3.1
ã©ã¤ãã©ãªã使ç¨(2024å¹´12ææç¹ã§ææ°ç)
対ç
ModalBottomSheet
ã¡ã½ããã®content
å
ã§ãå度isAppearanceLightStatusBars
ã®å¤ãå¤æ´ãããã(LocalView.current.parent as DialogWindowProvider).window
ã§window
ãåå¾ããã®ããã¤ã³ãã
ModalBottomSheet( onDismissRequest = { showBottomSheet = false }, sheetState = sheetState ) { //ã¹ãã¼ã¿ã¹ãã¼ãå¤æ´ val window = (LocalView.current.parent as DialogWindowProvider).window WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = false // Sheet content Button(onClick = { scope.launch { sheetState.hide() }.invokeOnCompletion { if (!sheetState.isVisible) showBottomSheet = false } }) { Text("Hide bottom sheet") } }