From 87ae5787ee4fdc06d77f1008bcfdef951a45dd6c Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Fri, 20 Mar 2020 21:39:38 +0100 Subject: [PATCH] [UX] Fix app quiting in home when back button opens drawer function active. --- app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 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 d8833ca9..dadaf833 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -1151,7 +1151,8 @@ class MainActivity : AppCompatActivity(), CoroutineScope { private var targetHomeId: Int = -1 override fun onBackPressed() { if (!b.navView.onBackPressed()) { - if (App.config.ui.openDrawerOnBackPressed && navTarget.popTo == null && navTarget.popToHome) { + if (App.config.ui.openDrawerOnBackPressed && ((navTarget.popTo == null && navTarget.popToHome) + || navTarget.id == DRAWER_ITEM_HOME)) { b.navView.drawer.toggle() } else { navigateUp()