From 8feb4365dda62110cb42b96281e15ae5a7d63d29 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 5 Feb 2020 22:53:49 -0500 Subject: [PATCH] Minor edit to onOptionsItemSelected fallthrough logic --- .../eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt | 3 +-- .../tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt | 3 +-- .../java/eu/kanade/tachiyomi/ui/download/DownloadController.kt | 3 +-- .../eu/kanade/tachiyomi/ui/extension/ExtensionController.kt | 3 +-- .../java/eu/kanade/tachiyomi/ui/library/LibraryController.kt | 3 +-- .../eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt | 3 +-- .../main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index 3ae684ce8..584da292f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -210,9 +210,8 @@ class CatalogueController : NucleusController(), .popChangeHandler(SettingsSourcesFadeChangeHandler()) .pushChangeHandler(FadeChangeHandler())) } - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt index 7d69d2e6d..4c476e31d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/browse/BrowseCatalogueController.kt @@ -289,9 +289,8 @@ open class BrowseCatalogueController(bundle: Bundle) : R.id.action_display_mode -> swapDisplayMode() R.id.action_set_filter -> navView?.let { activity?.drawer?.openDrawer(GravityCompat.END) } R.id.action_open_in_web_view -> openInWebView() - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } private fun openInWebView() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt index 7e61ccc70..5af88e427 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadController.kt @@ -116,9 +116,8 @@ class DownloadController : NucleusController() { DownloadService.stop(context) presenter.clearQueue() } - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt index 1848f7458..15691504e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt @@ -82,9 +82,8 @@ open class ExtensionController : NucleusController(), .popChangeHandler(SettingsExtensionsFadeChangeHandler()) .pushChangeHandler(FadeChangeHandler())) } - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 58f2cfee1..602eccc59 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -374,10 +374,9 @@ class LibraryController( R.id.action_source_migration -> { router.pushController(MigrationController().withFadeTransaction()) } - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt index c7fe29b75..1d1a6bc62 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt @@ -208,9 +208,8 @@ class ChaptersController : NucleusController(), activity?.invalidateOptionsMenu() } R.id.action_sort -> presenter.revertSortOrder() - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } fun onNextChapters(chapters: List) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 9f03bb996..54d1cd342 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -193,9 +193,8 @@ class ReaderActivity : BaseRxActivity() { when (item.itemId) { R.id.action_settings -> ReaderSettingsSheet(this).show() R.id.action_custom_filter -> ReaderColorFilterSheet(this).show() - else -> return super.onOptionsItemSelected(item) } - return true + return super.onOptionsItemSelected(item) } /**