bryankeltonadams
11/12/2025, 11:53 PMBottomSheetDefaults.windowInsets now includes <http://WindowInsets.safeDrawing.Top|WindowInsets.safeDrawing.Top>. (I0ab67, b/321877275, b/336962418, b/342093067)
This just makes it so the sheet is automatically padded by the statusBars, but I've been applying a color to my full screen content and not the sheet background color itself. I can fix it by setting WindowInsets(0.dp,0.dp,0.dp,0.dp) on the sheet and then consuming the WindowInsets on the content.bryankeltonadams
11/13/2025, 12:00 AMbryankeltonadams
11/13/2025, 12:01 AMbryankeltonadams
11/13/2025, 1:05 AMAlex Vanyo
11/13/2025, 4:09 PMcontentWindowInsets allows you to adjust the default insets that are accounted for by the sheet.bryankeltonadams
11/13/2025, 5:44 PMbryankeltonadams
11/13/2025, 6:33 PMval statusBarsPadding = WindowInsets.statusBars.asPaddingValues()
as a hack instead of being able to use .statusBarsPadding() modifierAlex Vanyo
11/13/2025, 6:36 PMbryankeltonadams
11/13/2025, 6:37 PMbryankeltonadams
11/13/2025, 6:39 PMbryankeltonadams
11/13/2025, 6:42 PMModalBottomSheet(
contentWindowInsets = {
WindowInsets(0.dp, 0.dp, 0.dp, 0.dp)
},
dragHandle = null, sheetState = sheetState, onDismissRequest = {
}) {
val statusBarsPadding = WindowInsets.statusBars.asPaddingValues()
Box(
modifier = Modifier
.fillMaxSize()
.background(color = Color.Red)
.padding(
statusBarsPadding
)
) {
Column(
modifier = Modifier
.fillMaxSize()
) {
Text(
text = "Hello World",
modifier = Modifier
)
}
}
}
This code gives me this on the latest version. Which is a hacky way (in my opinion since we have to use statusBarsPadding outside of the .statusBarsPadding() as to not have the insets consumed by the sheet) to get the old behavior. It basically acts like M3 1.3.0 ModalBottomSheet with statusBarsPadding applied to the content.bryankeltonadams
11/13/2025, 6:45 PMModalBottomSheet(
dragHandle = null, sheetState = sheetState, onDismissRequest = {
}) {
Box(
modifier = Modifier
.fillMaxSize()
.background(color = Color.Red)
) {
Column(
modifier = Modifier
.fillMaxSize()
) {
Text(
text = "Hello World",
modifier = Modifier
)
}
}
}
This code is just an out of the box usage of ModalBottomSheet.
Which gives in my opinion weird behavior. The white top slides down first, keeping the top portion of the red Box static, while the bottom portion of the red box stretches at the bottom. Then once you swipe past the white part, only then will the top portion of the content start sliding down.