So i am new to Jetpack compose and am trying to figure out how to add the drawer functionality to a button on my view.
A counterpart question that i found for my question in relation to the XML imperative approach Navigation Drawer without Actionbar
Would love to learn about the approach to the same.
You can accomplish this in many ways i guess. I will only post 2 alternatives
1- You can use Scaffold with
drawerContentand adding your layout as this contentOur drawer content
You need to set
scaffoldStateto have drawer to be able to open or close with other interactions other than drawable behavior.openDrawerandcloseDrawerlambdas are required if you need to open or close drawer like touching an item on drawer on content.2- Using ModalDrawer
With ModalDrawer you set your Content as you wish if you don't want to add TopAppBar you just don't add it inside content. I commented it here to display that it's not there.
You can check repo that contains implementations here.