From f4ce43787cdf9d6e334b210d78dbf437bb78c06e Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 11 Apr 2020 00:06:25 -0400 Subject: [PATCH] Controllers now properly remove their toolbar items on pop --- .../eu/kanade/tachiyomi/ui/base/controller/BaseController.kt | 1 + .../java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt | 1 - .../java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt index 569f08e8a8..1fcec6214d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/BaseController.kt @@ -61,6 +61,7 @@ abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateContr if (type.isEnter) { setTitle() } + setHasOptionsMenu(type.isEnter) super.onChangeStarted(handler, type) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index b6fbbc3afd..a4d6e85798 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -468,7 +468,6 @@ class MangaDetailsController : BaseController, if (router.backstack.lastOrNull()?.controller() is DialogController) return if (type == ControllerChangeType.POP_EXIT) { - setHasOptionsMenu(false) setActionBar(false) presenter.cancelScope() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt index e1ca8ddaac..70837aebb7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsController.kt @@ -79,6 +79,7 @@ abstract class SettingsController : PreferenceController() { if (type.isEnter) { setTitle() } + setHasOptionsMenu(type.isEnter) super.onChangeStarted(handler, type) }