From 593091a5e304eff771604ff2a91cdc0c886c4d68 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 23 Oct 2021 17:30:56 -0400 Subject: [PATCH] Sync view state with controller on activity resume Hopefully fixes some weird states where the bottom nav shows up when it shouldn't. --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 70e5e83db2..07ce03a59b 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 @@ -215,7 +215,7 @@ class MainActivity : BaseViewBindingActivity() { } ) - syncActivityViewWithController(router.backstack.lastOrNull()?.controller) + syncActivityViewWithController() if (savedInstanceState == null) { // Reset Incognito Mode on relaunch @@ -320,6 +320,7 @@ class MainActivity : BaseViewBindingActivity() { override fun onResume() { super.onResume() + syncActivityViewWithController() checkForUpdates() } @@ -488,7 +489,11 @@ class MainActivity : BaseViewBindingActivity() { } } - private fun syncActivityViewWithController(to: Controller?, from: Controller? = null, isPush: Boolean = true) { + private fun syncActivityViewWithController( + to: Controller? = router.backstack.lastOrNull()?.controller, + from: Controller? = null, + isPush: Boolean = true, + ) { if (from is DialogController || to is DialogController) { return }