Merge pull request #1925 from Hafizzle/Fiz/bottomsheet-dismiss-statusbar-color

Revert status bar color after hiding bottomsheet
This commit is contained in:
Phillip Thelen 2023-02-09 10:00:32 +01:00 committed by GitHub
commit 3030f65c52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,9 +77,9 @@ private fun BottomSheetWrapper(
var isSheetOpened by remember { mutableStateOf(false) }
val systemUiController = rememberSystemUiController()
val statusBarColor = colorResource(R.color.content_background).copy(alpha = 0.3f)
val statusBarColor = colorResource(R.color.content_background)
DisposableEffect(systemUiController) {
systemUiController.setStatusBarColor(statusBarColor, darkIcons = true)
systemUiController.setStatusBarColor(statusBarColor.copy(alpha = 0.3f), darkIcons = true)
onDispose {}
}
@ -132,7 +132,10 @@ private fun BottomSheetWrapper(
when (modalBottomSheetState.currentValue) {
ModalBottomSheetValue.Hidden -> {
when {
isSheetOpened -> parent.removeView(composeView)
isSheetOpened -> {
systemUiController.setStatusBarColor(statusBarColor, darkIcons = false)
parent.removeView(composeView)
}
else -> {
isSheetOpened = true
modalBottomSheetState.show()