Chris Fillmore
12/09/2021, 5:53 PMModalBottomSheetLayout
and BottomSheetNavigator
and I’d like my bottom sheets to open into Expanded
state. The HalfExpanded
state doesn’t really suit my use case as there is often a lot of content in the sheet, and/or the keyboard is up.
But, curiously, ModalBottomSheetState.expand()
is internal
and it’s not obvious to me how I could manipulate SwipeableState.anchors
.
Any advice? Thanks!BottomSheetScaffold
jossiwolf
12/09/2021, 7:34 PMModalBottomSheetLayout
soon (CL: https://android-review.googlesource.com/c/platform/frameworks/support/+/1891098, just need to update a small thing).
RE: BottomSheetNavigator
- you shouldn't be using a ModalBottomSheetState
explicitly if you are using Accompanist Nav Material, prefer using rememberBottomSheetNavigator
which sets this up for you. By holding a ModalBottomSheetState
on your own, you are risking BottomSheetNavigator
getting out of sync if you control it manually - the BottomSheetNavigator
constructor that takes the sheet state will be made internal soon too to avoid this.
Once we merge the CL upstream in Material, I'll add an API for this asap in Accompanist. (Hopefully something like end of next week or the week after)animateTo(ModalBottomSheetValue.Expanded
instead of expand()
Chris Fillmore
12/09/2021, 7:46 PM