Hi, is there a way to make the bottom sheet fully ...
# compose
s
Hi, is there a way to make the bottom sheet fully expandable and completely hide, I want to avoid the half expanded State with the new Navigation Material library?
3
j
No. We don't expose the sheet state and thus you can't apply the hack that skips the half expanded state. There's a request to add a
skipCollapsed
flag to Material's
ModalBottomSheetLayout
here: https://issuetracker.google.com/issues/186669820 Once
ModalBottomSheetLayout
supports it, we can support it in Navigation Material as well.
🙏 3
c
Kinda hijacking thread, but this got me thinking... if I just want the simplicity of a bottom sheet modal just like how you can easily add a dialog in compose, I wonder if I should just add a ModalBottomSheetLayout to the root of my app, and then when I need to use show a bottom sheet, I just pass the content up my app, and through my root which would show it. Hm. Just thinking out loud here. Still bummed there's not a "true" modal bottom sheet without having to rework my composable hierarchy.
1
j
Yeah, that works. See the "Why we need this library" section for an approach like that: https://jossiwolf.medium.com/introducing-navigation-material-%EF%B8%8F-a19ed5cc33fd
👍 1
@Colton Idle hacked a little thing together: https://gist.github.com/jossiwolf/f15299ae768a8b04fb1916a6f63f3dff I'm not saying you should do this... but it seems to work 😂 You still need to add the receiving
GlobalModalBottomSheetHost
as root but hey 🤷 This follows the SwiftUi approach of providing modifiers for sheets
K 1