Issue
I know that a normal bottom sheet can be setup like this
rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
confirmStateChange = { it != ModalBottomSheetValue.HalfExpanded },
)
So that it will never be half expanded. But what if I want to do the same in Accompanist navigation with bottomsheets?
Solution
I figured out how to do it.
val sheetState = rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
skipHalfExpanded = true
)
val bottomSheetNavigator = remember { BottomSheetNavigator(sheetState) }
val navController = rememberAnimatedNavController(bottomSheetNavigator)
Instead of using rememberBottomSheetNavigator()
you can just use the constructor of BottomSheetNavigator
which takes a sheetstate which can be set with a simple boolean. :)
Answered By - mama
Answer Checked By - Candace Johnson (JavaFixing Volunteer)