From b950370f12680e4113c1f736e656181fdf306579 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 11 May 2022 18:08:49 -0400 Subject: [PATCH] Address some build warnings --- .../java/eu/kanade/presentation/source/SourceFilterScreen.kt | 2 +- .../tachiyomi/extension/util/ExtensionInstallReceiver.kt | 5 +++-- .../browse/migration/sources/MigrationSourcesController.kt | 4 ++-- .../ui/browse/source/browse/BrowseSourceController.kt | 1 + .../eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt | 2 ++ .../tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt | 1 + .../kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt | 1 + .../kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt | 3 ++- 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/source/SourceFilterScreen.kt b/app/src/main/java/eu/kanade/presentation/source/SourceFilterScreen.kt index 4bf8b99755..09c196f97f 100644 --- a/app/src/main/java/eu/kanade/presentation/source/SourceFilterScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/source/SourceFilterScreen.kt @@ -37,7 +37,7 @@ fun SourceFilterScreen( when (state) { is SourceFilterState.Loading -> LoadingScreen() - is SourceFilterState.Error -> Text(text = (state as SourceFilterState.Error).error!!.message!!) + is SourceFilterState.Error -> Text(text = (state as SourceFilterState.Error).error.message!!) is SourceFilterState.Success -> SourceFilterContent( nestedScrollInterop = nestedScrollInterop, diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt index cdef6e4368..2cbc71cbd6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/util/ExtensionInstallReceiver.kt @@ -52,6 +52,7 @@ internal class ExtensionInstallReceiver(private val listener: Listener) : when (val result = getExtensionFromIntent(context, intent)) { is LoadResult.Success -> listener.onExtensionInstalled(result.extension) is LoadResult.Untrusted -> listener.onExtensionUntrusted(result.extension) + else -> {} } } } @@ -60,8 +61,8 @@ internal class ExtensionInstallReceiver(private val listener: Listener) : when (val result = getExtensionFromIntent(context, intent)) { is LoadResult.Success -> listener.onExtensionUpdated(result.extension) // Not needed as a package can't be upgraded if the signature is different - is LoadResult.Untrusted -> { - } + // is LoadResult.Untrusted -> {} + else -> {} } } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt index 136e418acc..c400c09263 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/sources/MigrationSourcesController.kt @@ -52,13 +52,13 @@ class MigrationSourcesController : ComposeController( } R.id.asc_alphabetical, R.id.desc_alphabetical, --> { + -> { presenter.setAlphabeticalSorting(itemId == R.id.asc_alphabetical) true } R.id.asc_count, R.id.desc_count, --> { + -> { presenter.setTotalSorting(itemId == R.id.asc_count) true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt index 67d76ac94e..00ac8da409 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/browse/BrowseSourceController.kt @@ -358,6 +358,7 @@ open class BrowseSourceController(bundle: Bundle) : when (filter) { is Filter.TriState -> filter.state = 1 is Filter.CheckBox -> filter.state = true + else -> {} } filterList = presenter.sourceFilters break@filter diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt index bd9ed749b4..427c9bcc56 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt @@ -394,6 +394,7 @@ class LibrarySettingsSheet( unreadBadge -> preferences.unreadBadge().set((item.checked)) localBadge -> preferences.localBadge().set((item.checked)) languageBadge -> preferences.languageBadge().set((item.checked)) + else -> {} } adapter.notifyItemChanged(item) } @@ -418,6 +419,7 @@ class LibrarySettingsSheet( when (item) { showTabs -> preferences.categoryTabs().set(item.checked) showNumberOfItems -> preferences.categoryNumberOfItems().set(item.checked) + else -> {} } adapter.notifyItemChanged(item) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt index b63d0db3cb..9c04ba10d1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersSettingsSheet.kt @@ -113,6 +113,7 @@ class ChaptersSettingsSheet( downloaded -> presenter.setDownloadedFilter(newState) unread -> presenter.setUnreadFilter(newState) bookmarked -> presenter.setBookmarkedFilter(newState) + else -> {} } initModels() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt index be427bab36..336cd57ae3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ReaderPageImageView.kt @@ -249,6 +249,7 @@ open class ReaderPageImageView @JvmOverloads constructor( ZoomStartPosition.LEFT -> setScaleAndCenter(scale, PointF(0F, 0F)) ZoomStartPosition.RIGHT -> setScaleAndCenter(scale, PointF(sWidth.toFloat(), 0F)) ZoomStartPosition.CENTER -> setScaleAndCenter(scale, center.also { it?.y = 0F }) + null -> {} } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt index e3209c3842..6ed163a2c2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt @@ -91,7 +91,8 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor( currentAnimator = null postInvalidate() } - },) + }, + ) } internal class SavedState : AbsSavedState {