mikepenz / MaterialDrawer

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
https://mikepenz.dev
Apache License 2.0
11.68k stars 2.05k forks source link

How to override the arrow_back button. #2571

Closed petrovyuri closed 4 years ago

petrovyuri commented 4 years ago

Hello. I hid the hamburger and showed the button arrow_back.

mDrawer.actionBarDrawerToggle?.isDrawerIndicatorEnabled = false mainActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true)

But when clicked , the driver opens. How to make the button work like a system onBaskPressed()?

Details

Checklist

mikepenz commented 4 years ago

if you do not want the Drawer to manage the toggle for you, simply don't provide the toolbar and things will be in your control :)

with v8 we also remove managing this completely

Sailoc commented 4 years ago

Hello, I have the same problem, I disabled the driver

` val drawer = result.drawerLayout

drawer.setDrawerLockMode (DrawerLayout.LOCK_MODE_LOCKED_OPEN) `

But when you click on the back button, the Driver opens.

mikepenz commented 4 years ago

If you do not want the drawer to close you should not call the close drawer method: https://github.com/mikepenz/MaterialDrawer/blob/develop/app/src/main/java/com/mikepenz/materialdrawer/app/MenuDrawerActivity.kt#L73

those things are all related to the DrawerLayout itself :)

Which is not part of this library or project

petrovyuri commented 4 years ago

Hello, I have the same problem, I disabled the driver

` val drawer = result.drawerLayout

drawer.setDrawerLockMode (DrawerLayout.LOCK_MODE_LOCKED_OPEN) `

But when you click on the back button, the Driver opens.

toolbar.setNavigationOnClickListener { // Do something here when you click on the button back... }