From 937d0852b3f7fb983f19663d0caff78b7f667bf2 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 1 May 2020 09:25:35 -0400 Subject: [PATCH] Always update sources list on enter (fixes #2999) --- .../ui/browse/extension/ExtensionController.kt | 2 +- .../ui/browse/source/SourceController.kt | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt index b056fc143c..a5e343906c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/extension/ExtensionController.kt @@ -188,7 +188,7 @@ open class ExtensionController : (parentController as BrowseController).setExtensionUpdateBadge() } - fun drawExtensions() { + private fun drawExtensions() { if (!query.isBlank()) { adapter?.updateDataSet( extensions.filter { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt index e4cb9f3982..1fff317822 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourceController.kt @@ -13,8 +13,6 @@ import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.list.listItems import com.bluelinelabs.conductor.ControllerChangeHandler import com.bluelinelabs.conductor.ControllerChangeType -import com.bluelinelabs.conductor.RouterTransaction -import com.bluelinelabs.conductor.changehandler.FadeChangeHandler import eu.davidea.flexibleadapter.FlexibleAdapter import eu.davidea.flexibleadapter.items.IFlexible import eu.kanade.tachiyomi.R @@ -103,7 +101,7 @@ class SourceController : override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) { super.onChangeStarted(handler, type) - if (!type.isPush && handler is SettingsSourcesFadeChangeHandler) { + if (type.isPush) { presenter.updateSources() } } @@ -205,8 +203,10 @@ class SourceController : .launchIn(scope) } - fun performGlobalSearch(query: String) { - (parentController as BrowseController).pushController(GlobalSearchController(query).withFadeTransaction()) + private fun performGlobalSearch(query: String) { + (parentController as BrowseController).pushController( + GlobalSearchController(query).withFadeTransaction() + ) } /** @@ -220,9 +220,7 @@ class SourceController : // Initialize option to open catalogue settings. R.id.action_settings -> { (parentController as BrowseController).pushController( - (RouterTransaction.with(SettingsSourcesController())) - .popChangeHandler(SettingsSourcesFadeChangeHandler()) - .pushChangeHandler(FadeChangeHandler()) + SettingsSourcesController().withFadeTransaction() ) } } @@ -246,6 +244,4 @@ class SourceController : adapter?.addScrollableHeader(LangItem(SourcePresenter.LAST_USED_KEY)) } } - - class SettingsSourcesFadeChangeHandler : FadeChangeHandler() }