I'm trying to migrate my android app to compose and I'm having some trouble figuring out how to make a drawer that opens with an AppBar button. I tried to set it through drawerContent in a scaffold, but that seems to use a dragging gesture instead of a button in the AppBar
✅ 1
Jayden King
05/19/2024, 11:57 AM
this is how it looks in my android app, tapping the hamburger icon opens the drawer
In the Scaffold you can disable the drawer gesture and only open it with an a button or some action
j
Jayden King
05/19/2024, 12:31 PM
I just tried that with
drawerGesturesEnabled = false
, but now I can't close the drawer by tapping off the drawer. Is it possible to disable dragging the drawer open without disabling closing it with a tap?
t
Tomislav Mladenov
05/19/2024, 12:32 PM
Yes you can intercept a tap, click, touch any gesture and simply send some callback, flow or event to the composable. There you can control the state if the drawer
j
Jayden King
05/19/2024, 12:35 PM
oh, apparently you can do it just by setting it as