https://kotlinlang.org logo
Title
m

mattinger

03/23/2023, 2:51 PM
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

Albert Chang

03/23/2023, 3:19 PM
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

Colton Idle

03/23/2023, 4:41 PM
s

Stylianos Gakis

03/23/2023, 5:02 PM
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

Oleksandr Balan

03/23/2023, 7:16 PM
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

Stylianos Gakis

03/23/2023, 7:19 PM
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

Oleksandr Balan

03/23/2023, 7:25 PM
I have no idea, but I hope so 🙈 It is a pretty common component 🤷‍♂️
a

Andy Himberger

03/24/2023, 3:35 AM
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