Actual behavior
Acting like back button → go back on bottomSheet(bottom1)
Solution 1
Make BottomSheetNavigator and its sheetContent attribute open to make possible to developers to override and chose the behavior.
By doing it, you need to alter visibility of some other attributes.
Solution 2
Add an optional function in parameter on BottomSheetNavigator to define a custom behavior for OnSheetDismissed if the function is not null.
Solution 3
Add a parameter on BottomSheetNavigator to tell if dismiss should act like back button or dismiss the entire chain of bottom sheets
Description After navigating like this: composable(screen1) → bottomSheet(bottom1) → bottomSheet(bottom2)
Then user dismissed bottomSheet(bottom2) by clicking on backdrop or swipe down
Expected behavior I wish I could go directly back to composable(screen1).
https://user-images.githubusercontent.com/83081700/182813568-74e625e8-8ded-454a-ac47-3b50297bf776.mov
Actual behavior Acting like back button → go back on bottomSheet(bottom1)
Solution 1 Make
BottomSheetNavigator
and itssheetContent
attributeopen
to make possible to developers to override and chose the behavior. By doing it, you need to alter visibility of some other attributes.Solution 2 Add an optional function in parameter on
BottomSheetNavigator
to define a custom behavior forOnSheetDismissed
if the function is not null.Solution 3 Add a parameter on
BottomSheetNavigator
to tell if dismiss should act like back button or dismiss the entire chain of bottom sheetsExample You can find an example of solution 1 on my sample repository: https://github.com/bamlab/android-navigable-bottom-sheet
PS : If there is another solution to my problem in the current version of the library (0.25.0). Let me know !