https://kotlinlang.org logo
Title
l

Lucien Guimaraes

01/25/2022, 7:34 PM
Is possible to have a navigation between Standard sheets? ModalBottomSheetLayout from Accompanist only works for Modal sheets. And even by setting the
scrimColor
parameter to
Color.Unspecified
, to make sheets looks like standard sheets, we don't have control over the peekHeight.
i

Ian Lake

01/25/2022, 7:43 PM
What does 'navigating between standard sheets' actually mean in your case? Swapping out the contents of the sheet? You can certainly put a NavHost within the sheet content if you want to do that
☝️🏽 1
l

Lucien Guimaraes

01/25/2022, 7:55 PM
Just like the Accompanist library, being able to navigate between two standard sheets for instance (instead of updating the content of the sheet with a NavHost)
i

Ian Lake

01/25/2022, 7:57 PM
I don't think that makes sense for a standard sheet, which is a persistent fixture on your screen and not something you temporarily show/hide or navigate to. Can you explain what design pattern you are trying to accomplish?
1
l

Lucien Guimaraes

01/25/2022, 8:05 PM
I'm trying to achieve what the iOS team have done. They have two standard sheets in one screen, and they are able to switch between the two. (the first sheet is just a button for now, but it will be filled with more components)
c

curioustechizen

01/25/2022, 9:03 PM
I wonder if this can be simulated using a single sheet with a NavHost in it and using animations. There's AnimatedNavHost Composable in Accompanist library.
1
l

Lucien Guimaraes

01/26/2022, 10:36 AM
Yeah with a NavHost it does the job, that's my current implementation. And even without AnimatedNavHost, but just with
Modifier.onGloballyPositioned
the sheet resize properly. I just wanted to know if it was possible to have it as separated sheets