Controllers now properly remove their toolbar items on pop

This commit is contained in:
Jay 2020-04-11 00:06:25 -04:00
parent b5699154f4
commit f4ce43787c
3 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@ abstract class BaseController(bundle: Bundle? = null) : RestoreViewOnCreateContr
if (type.isEnter) { if (type.isEnter) {
setTitle() setTitle()
} }
setHasOptionsMenu(type.isEnter)
super.onChangeStarted(handler, type) super.onChangeStarted(handler, type)
} }

View File

@ -468,7 +468,6 @@ class MangaDetailsController : BaseController,
if (router.backstack.lastOrNull()?.controller() is DialogController) if (router.backstack.lastOrNull()?.controller() is DialogController)
return return
if (type == ControllerChangeType.POP_EXIT) { if (type == ControllerChangeType.POP_EXIT) {
setHasOptionsMenu(false)
setActionBar(false) setActionBar(false)
presenter.cancelScope() presenter.cancelScope()
} }

View File

@ -79,6 +79,7 @@ abstract class SettingsController : PreferenceController() {
if (type.isEnter) { if (type.isEnter) {
setTitle() setTitle()
} }
setHasOptionsMenu(type.isEnter)
super.onChangeStarted(handler, type) super.onChangeStarted(handler, type)
} }