0

Upon several research, what I concluded as, we cannot use the hamburger icon to open navigation drawer without using the toolbar.

  private fun setDrawer(){
        appCompatActivity.setSupportActionBar(binding!!.toolbar)
       
        appCompatActivity.getSupportActionBar()!!.setDisplayHomeAsUpEnabled(true);
        drawerLayout = binding!!.myDrawerLayout
        actionBarDrawerToggle = ActionBarDrawerToggle(appCompatActivity, drawerLayout,binding!!.toolbar, R.string.app_name, R.string.app_name)
        drawerLayout?.addDrawerListener(actionBarDrawerToggle!!)
        actionBarDrawerToggle!!.syncState()
    }

Finally I achieved my desired design putting same color with whole page and that toolbar view which is presented as below.
So, can I achieve this using another approach?

A desired Image Link is::
enter image description here

Hubby Tiwari
  • 243
  • 2
  • 10
  • 1
    Sure, but not with `ActionBarDrawerToggle`, as it's only meant for that specific use. All that class really does, though, is act as a relay between the button/drawable and the `DrawerLayout`. You could set up something similar with whatever button or `View` you like. [My answer here](https://stackoverflow.com/a/39136512) shows how to move that button to the other side of the `Toolbar`, but you can see how it's actually creating its own separate `AppCompatImageButton` internally. That button doesn't have to be added to the `Toolbar`; you could put it, or just the drawable, wherever you like. – Mike M. Jan 22 '22 at 16:02

0 Answers0