Close drawer first, if open
This commit is contained in:
@@ -212,7 +212,9 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
if (!navController.navigateUp()) {
|
if (B.drawerLayout.isDrawerOpen(GravityCompat.START)) {
|
||||||
|
B.drawerLayout.close()
|
||||||
|
} else if (!navController.navigateUp()) {
|
||||||
if (lastBackPressed + 1000 > System.currentTimeMillis()) {
|
if (lastBackPressed + 1000 > System.currentTimeMillis()) {
|
||||||
super.onBackPressed()
|
super.onBackPressed()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user