This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YourAppTheme { | |
val coroutineScope = rememberCoroutineScope() | |
val sheetState = rememberModalBottomSheetState( | |
initialvalue = ModalBottomSheetValue.Hidden | |
) | |
ModalBottomSheetLayout( | |
sheetContent = { YourSheetContent() }, | |
sheetState = sheetState | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Accompanist Insets | |
implementation 'com.google.accompanist:accompanist-insets:0.17.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WindowCompat.setDecorFitsSystemWindows(window, false) | |
setContent { | |
//... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Status bar color. --> | |
<item name="android:statusBarColor">@android:color/transparent</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// System UI Controller | |
implementation "com.google.accompanist:accompanist-systemuicontroller:0.17.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun YourTheme( | |
darkTheme: Boolean = isSystemInDarkTheme(), | |
content: @Composable () -> Unit | |
) { | |
val systemUiController = rememberSystemUiController() | |
systemUiController.setStatusBarColor(Color.Transparent) | |
MaterialTheme( | |
content = content | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ModalBottomSheetLayout( | |
sheetContent = { SheetContent() }, | |
sheetState = sheetState | |
) { | |
Column { | |
Spacer(modifier = Modifier | |
.background(MaterialTheme.colors.primary) | |
.statusBarsHeight() | |
.fillMaxWidth() | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setContent { | |
ModalBottomSheetTheme { | |
ProvideWindowInsets { | |
Content() | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemUiController.setNavigationBarColor( | |
color = Color.Transparent, | |
darkIcons = true, | |
navigationBarContrastEnforced = false | |
) |
OlderNewer