I have a custom bottom sheet scaffold and the draggable bottomsheet part calculates its
bottomSheetOffset
using
onPlaced
and pass to the scaffold
bottomSheet = {
Surface(
swipeable
.fillMaxWidth()
.onPlaced {
bottomSheetOffset =
it.positionInParent()
},
shape = sheetShape,
elevation = sheetElevation,
color = sheetBackgroundColor,
contentColor = sheetContentColor,
content = {
scaffoldState.bottomSheetState.sheetContent()
}
)
},
and in scaffold, I calculate padding in pixels for main content as
LocalConfiguration.current.screenHeightDp.dp.toPx() - bottomSheetOffset.y
On Pixel 6. when bottom sheet is fully collapsed, I get
bottomSheetOffset.y
as 2274.0 and
LocalConfiguration.current.screenHeightDp.dp.toPx()
as 2273.25