dimsuz
06/08/2021, 2:41 PMsheetPeekHeight
based on a parent layout? For example if I have a column with a few composables and I want the BottomSheet in collapsed state to be just below the last one of them, how would I go about this? I thought about a custom Layout
modifier to measure children height, but how do I then pass this into sheetPeekHeight
?nitrog42
06/08/2021, 3:08 PMSpacer(
Modifier
.onGloballyPositioned {
//Calculate the height of the sheet to display when collapsed
if (!expanded) {
onPeekSizeCalculated(it.positionInParent().y)
}
}
}
You can either use a lambda to know the value, or use a mutablestate (peekSize = it.positionInParent.y)dimsuz
06/08/2021, 3:21 PM