Question regarding bottom-sheet, when using Materi...
# compose-destinations
d
Question regarding bottom-sheet, when using Material 3 what is the go to way of using bottom sheet? The documentation says to use
ModalBottomSheetLayout
but it derives from
androidx.compose.material.navigation
and then yields the following warning:
Using a material import while also using the material3 library More... (⌘F1)
. I can ignore it and it sort of works, but it lacks support for predictive back, is there another way to go about using the bottom sheet? https://composedestinations.rafaelcosta.xyz/v2/styles-and-animations?_highlight=bottom&_highlight=sheet#bottomsheet-style
Saw this post earlier this year: https://kotlinlang.slack.com/archives/C06CS4UCQ10/p1712934454505559 Seems as of right now, if I understand it right, we have to imbed the MaterialBottomSheet into the view or suppress this warning. From my testing it seems like it works (but no predictive back), but there could be caveats I'm not aware of.
r
Hey @David! have you ever seen predictive back when closing a dialog / bottom sheet? 🤔 Should be clear that you're going back to screen underneath it, right?
As far as I am aware, if you want a bottom sheet registered as a navigation destination, you cannot use material 3 bottom sheet.
I agree that it is obvious where it will lead but the current beta will animate the sheet down as you swipe back, with ModalBottomSheetLayout this is not supported. I spent a little time on it today and unfortunately the ModalBottomSheetLayout in navigation uses some internal values to render the sheet. From what I've seen no such thing exists for Material 3 yet.
👍 1
Found the following is issue covering it on the tracker, no response yet though: https://issuetracker.google.com/issues/346717094
119 Views