From 5cd11ad8c357d1057474dc0ab660068f7982573d Mon Sep 17 00:00:00 2001 From: Ivan Iskandar <12537387+ivaniskandar@users.noreply.github.com> Date: Sun, 30 Jan 2022 01:55:33 +0700 Subject: [PATCH] Fix bottom nav showing on resume when action mode is active (#6514) --- .../kanade/tachiyomi/ui/main/MainActivity.kt | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index a97d9eb40..72b6eeb8d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -194,17 +194,6 @@ class MainActivity : BaseViewBindingActivity() { val container: ViewGroup = binding.controllerContainer router = Conductor.attachRouter(this, container, savedInstanceState) - if (!router.hasRootController()) { - // Set start screen - if (!handleIntentAction(intent)) { - setSelectedNavItem(startScreenId) - } - } - - binding.toolbar.setNavigationOnClickListener { - onBackPressed() - } - router.addChangeListener( object : ControllerChangeHandler.ControllerChangeListener { override fun onChangeStarted( @@ -227,6 +216,17 @@ class MainActivity : BaseViewBindingActivity() { } } ) + if (!router.hasRootController()) { + // Set start screen + if (!handleIntentAction(intent)) { + setSelectedNavItem(startScreenId) + } + } + syncActivityViewWithController() + + binding.toolbar.setNavigationOnClickListener { + onBackPressed() + } if (savedInstanceState == null) { // Reset Incognito Mode on relaunch @@ -337,7 +337,6 @@ class MainActivity : BaseViewBindingActivity() { override fun onResume() { super.onResume() checkForUpdates() - syncActivityViewWithController() } private fun checkForUpdates() {