https://kotlinlang.org logo
#compose
Title
# compose
a

Abhishek Dewan

06/04/2021, 6:51 AM
Hi I am seeing something weird with the bottomSheetScaffold where the following scenario is leading to the bottom sheet not showing up. Starting with a collapsed state -> call expand on the bottomSheetState -> Do some work -> call collapse on the bottomSheetState -> call expand on the bottom sheet state again and the sheet doesn't expand. Upon debugging I do see that the bottomSheetState.isCollapsed is set to true before I call expand a second time. Also putting a debug pointer in the animateTo function the
latestNonEmptyAnchorsFlow
never collects. Am I doing something wrong here ?
Fixed 😄
Using compose beta06 at the moment
I am dumb. Creating the bottomSheetScaffoldState needs to be done
Copy code
val scaffoldState = rememberBottomSheetScaffoldState(
    bottomSheetState = rememberBottomSheetState(initialValue = BottomSheetValue.Collapsed)
)
instead of what I had earlier
Copy code
val scaffoldState = rememberBottomSheetScaffoldState(
    bottomSheetState = BottomSheetState(BottomSheetValue.Collapsed)
)
3 Views