From 6f1ec79d9b3214770680cc9c3b116448ef451315 Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Fri, 20 Mar 2020 14:21:13 +0100 Subject: [PATCH] [UX] Fix back button opens drawer function always opening the drawer. --- app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 40ab9215..d8833ca9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -1151,7 +1151,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope { private var targetHomeId: Int = -1 override fun onBackPressed() { if (!b.navView.onBackPressed()) { - if (App.config.ui.openDrawerOnBackPressed) { + if (App.config.ui.openDrawerOnBackPressed && navTarget.popTo == null && navTarget.popToHome) { b.navView.drawer.toggle() } else { navigateUp()