Reputation: 790
I have a ModalBottomSheetLayout
with a list of items in my Compose view, which can be showed by some UI interaction.
By default, when bottomSheetState.show()
is called, the visible ratio for the BottomSheet is 50%. However, this is not ideal from a UX perspective as the user will have to physically pull up the bottom sheet to see all the contents in the list.
Extremely frustrating is the fact that bottomSheetState.show()
does not take in any parameters, and that the 50% value seems to be hard coded in. According to the declaration in androix.compose.material
:
suspend fun show() {
val targetValue =
if (isHalfExpandedEnabled) HalfExpanded
else Expanded
animateTo(targetValue = targetValue)
}
I would like to instead show a custom value, say 75%, when the bottom sheet is showed, but so far I haven't found a way to do so. Is there a workaround to this?
Upvotes: 1
Views: 824
Reputation: 1348
I am not sure if you can make it 75% visible but you can show it expanded
bottomSheetState.animateTo(ModalBottomSheetValue.Expanded)
Upvotes: 1