Closed chandroidx closed 6 months ago
Hey @chandroidx, my apologies for the delayed response. It's expected that this task falls under the responsibility of the user.
To address this issue, you can easily change the status bar color using the following method:
Add the accompanist dependency below:
implementation("com.google.accompanist:accompanist-systemuicontroller:0.32.0")
Observe the flexible bottom sheet's target value changes and change the statusbar color when the state value is not hidden like the example below:
var currentSheetTarget by remember { mutableStateOf(FlexibleSheetValue.IntermediatelyExpanded) }
val systemUiController = rememberSystemUiController()
val primaryColor = MaterialTheme.colors.primary
val scrimColor = Color.Black.copy(alpha = 0.65f)
LaunchedEffect(currentSheetTarget) {
if (currentSheetTarget == FlexibleSheetValue.Hidden) {
systemUiController.setStatusBarColor(
color = primaryColor
)
} else {
systemUiController.setStatusBarColor(
color = scrimColor
)
}
}
FlexibleBottomSheet(
onDismissRequest = onDismissRequest,
sheetState = rememberFlexibleBottomSheetState(
flexibleSheetSize = FlexibleSheetSize(),
isModal = true,
skipSlightlyExpanded = false,
),
onTargetChanges = { sheetValue ->
currentSheetTarget = sheetValue
},
containerColor = Color.Black,
scrimColor = scrimColor
) {
..
}
This is the result as you've expected:
Hey @chandroidx, I'm closing this issue for now. If you still face the same problem while addressing it with my suggestion, please reopen and discuss this anytime!
Please complete the following information:
Describe the Bug: With only Horizontal sides' insets scrim doesn't contain status bar 🧐
Expected Behavior:
A clear description of what you expected to happen.