Does anyone know how to properly handle bottom she...
# compose
m
Does anyone know how to properly handle bottom sheets in a hybrid app (part xml, part compose)? Basically the issue is that ModalBottomSheetLayout cannot scrim content that is not part of it’s child content, nor can it or BottomSheetScaffold have the sheet cover content that is not part it’s child content. In a hybrid type of app, the compose portion is likely not to be in control of the entire screen. Would the recommendation still be to use BottomSheetDialogFragment and BottomSheetBehavior, but have the views be written in compose?
a
There is
ModalBottomSheet
in material 3 which shows bottom sheet in a new window. Not sure if it will be added to material 2 but I think you can just copy the source if you want to use it in material 2 now.
c
s
With the m3 ModalBottomSheet existing, is there a reason to use this library? I haven’t used it myself so far so just curious if it does something that the m3 component does not
o
It was built on m2 lib, and I believe when
ModalBottomSheet
is ported to m2, then this lib could be deprecated. The idea was pretty similar to how m3 version is implemented, it adds a
ModalBottomSheetLayout
to the custom fullscreen popup, which is added to the window.
s
Awesome thanks for the explanation. So in short if someone is using m3 they might as well use the m3 component directly. But I don't know if this will ever get backported to m2, in general they still have a lot of work to do with m3, not sure if they're updating m2 components at the same time, do they?
o
I have no idea, but I hope so 🙈 It is a pretty common component 🤷‍♂️
a
while the m3 bottomsheet API is much better, it is really buggy right now, seeing a lot of cases where the bottom content of the bottomsheet is not visible