So i'm having a bit of trouble with ModalBottomShe...
# android
m
So i'm having a bit of trouble with ModalBottomSheet. It seems that • The dialog itself can be full edge to edge, instead of the scrim occupying the portion that would overlap with the system status bars • The default drag handle does not accomodate the system status bars padding. • The content does not accomodate the navigation bars padding. I can add my own drag handle (even if i call the default one) and having it move down by using the .statusBarsPadding modifier so that it's actually visible and actionable, but i would have expected the ModalBottomSheet function to have some of this accounted for already. And on top of that, it gets applied even if the bottom sheet isn't tall enough to cover the system status bars, so i end up with a lot of extra space at the top of the drag handle.
Copy code
@OptIn(ExperimentalMaterial3Api::class)
@Composable
@Preview
fun ModalBottomSheetPreview() {
    ModalBottomSheet(
        sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
        onDismissRequest = {}
    ) {
        Column(modifier = Modifier.verticalScroll(rememberScrollState())){
            (0..100).forEach {
                Text(text = "Text${it}")
            }

        }

    }
}
Here's an example where i've applied the statusBarsPadding but there's not enough content to push it full screen.
Update: The solution is to apply the
statusBarPadding()
modifier to the modifier i pass to ModalBottomSheet. That ensures that the scrim will cover the status bar and shift the sheet content down so that it won't overlap with the status bar.