From 620be2617a61d4390f3969d0019545048a887744 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 16 May 2020 12:28:11 -0400 Subject: [PATCH] Remove redundant helper function --- .../java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt | 4 ---- .../tachiyomi/ui/browse/extension/ExtensionController.kt | 4 ++-- .../kanade/tachiyomi/ui/browse/source/SourceController.kt | 6 +++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt index f3245cc83..af11ef978 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt @@ -95,10 +95,6 @@ class BrowseController : tabs.getTabAt(EXTENSIONS_CONTROLLER)?.removeBadge() } - fun pushController(transaction: RouterTransaction) { - router.pushController(transaction) - } - fun setExtensionUpdateBadge() { activity?.tabs?.apply { val updates = preferences.extensionUpdatesCount().get() 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 b9ceb7643..667fa08c8 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 @@ -87,7 +87,7 @@ open class ExtensionController : when (item.itemId) { R.id.action_search -> expandActionViewFromInteraction = true R.id.action_settings -> { - (parentController as BrowseController).pushController( + parentController!!.router.pushController( ExtensionFilterController().withFadeTransaction() ) } @@ -167,7 +167,7 @@ open class ExtensionController : private fun openDetails(extension: Extension.Installed) { val controller = ExtensionDetailsController(extension.pkgName) - (parentController as BrowseController).pushController(controller.withFadeTransaction()) + parentController!!.router.pushController(controller.withFadeTransaction()) } private fun openTrustDialog(extension: Extension.Untrusted) { 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 a69ce7993..2c604992c 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 @@ -185,7 +185,7 @@ class SourceController : */ private fun openCatalogue(source: CatalogueSource, controller: BrowseSourceController) { preferences.lastUsedCatalogueSource().set(source.id) - (parentController as BrowseController).pushController(controller.withFadeTransaction()) + parentController!!.router.pushController(controller.withFadeTransaction()) } /** @@ -214,7 +214,7 @@ class SourceController : } private fun performGlobalSearch(query: String) { - (parentController as BrowseController).pushController( + parentController!!.router.pushController( GlobalSearchController(query).withFadeTransaction() ) } @@ -229,7 +229,7 @@ class SourceController : when (item.itemId) { // Initialize option to open catalogue settings. R.id.action_settings -> { - (parentController as BrowseController).pushController( + parentController!!.router.pushController( SettingsSourcesController().withFadeTransaction() ) }