From 3966a917ee76f007e581cf5c94a48d29090ef2c6 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 13 Aug 2022 12:46:00 -0400 Subject: [PATCH] Bump dependencies + compile SDK to 33 + linting --- app/build.gradle.kts | 20 +++++----- app/src/main/AndroidManifest.xml | 3 +- .../data/updater/AppUpdateChecker.kt | 1 + .../util/ExtensionInstallReceiver.kt | 5 ++- .../controller/SearchableNucleusController.kt | 21 +++++----- .../source/browse/BrowseSourceController.kt | 1 + .../ui/download/DownloadHeaderHolder.kt | 3 +- .../tachiyomi/ui/library/LibraryController.kt | 4 +- .../ui/library/LibrarySettingsSheet.kt | 2 + .../kanade/tachiyomi/ui/main/MainActivity.kt | 2 +- .../ui/manga/chapter/ChaptersSettingsSheet.kt | 1 + .../tachiyomi/ui/reader/ReaderActivity.kt | 17 ++++---- .../ui/reader/model/ReaderChapter.kt | 6 +-- .../ui/reader/setting/ReaderSettingsSheet.kt | 35 ++++++++-------- .../ui/reader/viewer/ReaderPageImageView.kt | 3 +- .../ui/reader/viewer/webtoon/WebtoonFrame.kt | 8 ++-- .../ui/setting/SettingsMainController.kt | 4 +- .../search/SettingsSearchController.kt | 4 +- .../tachiyomi/ui/webview/WebViewActivity.kt | 4 +- .../widget/TachiyomiBottomNavigationView.kt | 13 +++--- .../widget/preference/ThemesPreference.kt | 13 +++--- .../widget/sheet/BottomSheetViewPager.kt | 11 ++--- buildSrc/src/main/kotlin/AndroidConfig.kt | 2 +- gradle/androidx.versions.toml | 6 +-- gradle/kotlinx.versions.toml | 13 +++--- gradle/libs.versions.toml | 40 ++++++++++--------- 26 files changed, 128 insertions(+), 114 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4ab658238..83121b5e9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -18,6 +18,7 @@ shortcutHelper.setFilePath("./shortcuts.xml") val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86") android { + namespace = "eu.kanade.tachiyomi" compileSdk = AndroidConfig.compileSdk ndkVersion = AndroidConfig.ndk @@ -246,6 +247,7 @@ dependencies { // For detecting memory leaks; see https://square.github.io/leakcanary/ // debugImplementation(libs.leakcanary.android) + implementation(libs.leakcanary.plumber) } tasks { @@ -259,19 +261,19 @@ tasks { // See https://kotlinlang.org/docs/reference/experimental.html#experimental-status-of-experimental-api(-markers) withType { kotlinOptions.freeCompilerArgs += listOf( - "-Xopt-in=kotlin.Experimental", - "-Xopt-in=kotlin.RequiresOptIn", - "-Xopt-in=kotlin.ExperimentalStdlibApi", - "-Xopt-in=kotlinx.coroutines.FlowPreview", - "-Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", - "-Xopt-in=kotlinx.coroutines.InternalCoroutinesApi", - "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi", - "-Xopt-in=coil.annotation.ExperimentalCoilApi", + "-opt-in=kotlin.Experimental", + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=kotlin.ExperimentalStdlibApi", + "-opt-in=kotlinx.coroutines.FlowPreview", + "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi", + "-opt-in=kotlinx.coroutines.InternalCoroutinesApi", + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi", + "-opt-in=coil.annotation.ExperimentalCoilApi", ) } // Duplicating Hebrew string assets due to some locale code issues on different devices - val copyHebrewStrings = task("copyHebrewStrings", type = Copy::class) { + val copyHebrewStrings by registering(Copy::class) { from("./src/main/res/values-he") into("./src/main/res/values-iw") include("**/*") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8688d7f3d..3fc615c53 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt index 60460dc98..d6a15452e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AppUpdateChecker.kt @@ -47,6 +47,7 @@ class AppUpdateChecker { when (result) { is AppUpdateResult.NewUpdate -> AppUpdateNotifier(context).promptUpdate(result.release) is AppUpdateResult.NewUpdateFdroidInstallation -> AppUpdateNotifier(context).promptFdroidUpdate() + else -> {} } result 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 cdef6e436..943e82845 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/base/controller/SearchableNucleusController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt index 15f677bbc..fa0321304 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/base/controller/SearchableNucleusController.kt @@ -59,16 +59,17 @@ abstract class SearchableNucleusController 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/download/DownloadHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHeaderHolder.kt index 59d604974..3362c99ed 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/download/DownloadHeaderHolder.kt @@ -28,8 +28,7 @@ class DownloadHeaderHolder(view: View, adapter: FlexibleAdapter<*>) : Expandable override fun onItemReleased(position: Int) { super.onItemReleased(position) binding.container.isDragged = false - mAdapter as DownloadAdapter mAdapter.expandAll() - mAdapter.downloadItemListener.onItemReleased(position) + (mAdapter as DownloadAdapter).downloadItemListener.onItemReleased(position) } } 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 aa8b9efa1..9bbaa47fd 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 @@ -388,7 +388,7 @@ class LibraryController( override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { createOptionsMenu(menu, inflater, R.menu.library, R.id.action_search) // Mutate the filter icon because it needs to be tinted and the resource is shared. - menu.findItem(R.id.action_filter).icon.mutate() + menu.findItem(R.id.action_filter).icon?.mutate() } fun search(query: String) { @@ -414,7 +414,7 @@ class LibraryController( // Tint icon if there's a filter active if (settingsSheet.filters.hasActiveFilters()) { val filterColor = activity!!.getResourceColor(R.attr.colorFilterActive) - filterItem.icon.setTint(filterColor) + filterItem.icon?.setTint(filterColor) } } 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 2991a9729..dcd0c5cd6 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/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 04dc53036..e31a8afe8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -466,7 +466,7 @@ class MainActivity : BaseActivity() { // Binding sometimes isn't actually instantiated yet somehow nav?.setOnItemSelectedListener(null) - binding?.toolbar.setNavigationOnClickListener(null) + binding?.toolbar?.setNavigationOnClickListener(null) } override fun onBackPressed() { 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 b63d0db3c..9c04ba10d 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/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index 5b8a07af3..110e02aa1 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 @@ -360,15 +360,16 @@ class ReaderActivity : BaseRxActivity() { } // Init listeners on bottom menu - binding.pageSlider.addOnSliderTouchListener(object : Slider.OnSliderTouchListener { - override fun onStartTrackingTouch(slider: Slider) { - isScrollingThroughPages = true - } + binding.pageSlider.addOnSliderTouchListener( + object : Slider.OnSliderTouchListener { + override fun onStartTrackingTouch(slider: Slider) { + isScrollingThroughPages = true + } - override fun onStopTrackingTouch(slider: Slider) { - isScrollingThroughPages = false - } - }, + override fun onStopTrackingTouch(slider: Slider) { + isScrollingThroughPages = false + } + }, ) binding.pageSlider.addOnChangeListener { slider, value, fromUser -> if (viewer != null && fromUser) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt index b475c6a4f..a332a96ec 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt @@ -10,9 +10,9 @@ data class ReaderChapter(val chapter: Chapter) { var state: State = State.Wait set(value) { - field = value - stateRelay.call(value) - } + field = value + stateRelay.call(value) + } private val stateRelay by lazy { BehaviorRelay.create(state) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt index 4e22f8418..14386d3c5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReaderSettingsSheet.kt @@ -34,27 +34,28 @@ class ReaderSettingsSheet( behavior.halfExpandedRatio = 0.25f val filterTabIndex = getTabViews().indexOf(colorFilterSettings) - binding.tabs.addOnTabSelectedListener(object : SimpleTabSelectedListener() { - override fun onTabSelected(tab: TabLayout.Tab?) { - val isFilterTab = tab?.position == filterTabIndex + binding.tabs.addOnTabSelectedListener( + object : SimpleTabSelectedListener() { + override fun onTabSelected(tab: TabLayout.Tab?) { + val isFilterTab = tab?.position == filterTabIndex - // Remove dimmed backdrop so color filter changes can be previewed - backgroundDimAnimator.run { - if (isFilterTab) { - if (animatedFraction < 1f) { - start() + // Remove dimmed backdrop so color filter changes can be previewed + backgroundDimAnimator.run { + if (isFilterTab) { + if (animatedFraction < 1f) { + start() + } + } else if (animatedFraction > 0f) { + reverse() } - } else if (animatedFraction > 0f) { - reverse() + } + + // Hide toolbars + if (activity.menuVisible != !isFilterTab) { + activity.setMenuVisibility(!isFilterTab) } } - - // Hide toolbars - if (activity.menuVisible != !isFilterTab) { - activity.setMenuVisibility(!isFilterTab) - } - } - }, + }, ) if (showColorFilterSettings) { 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 be427bab3..c6f114088 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 }) + else -> {} } } @@ -310,7 +311,7 @@ open class ReaderPageImageView @JvmOverloads constructor( return true } - override fun onSingleTapConfirmed(e: MotionEvent?): Boolean { + override fun onSingleTapConfirmed(e: MotionEvent): Boolean { this@ReaderPageImageView.onViewClicked() return super.onSingleTapConfirmed(e) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt index db711efbb..323cf0f63 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonFrame.kt @@ -44,7 +44,7 @@ class WebtoonFrame(context: Context) : FrameLayout(context) { * Scale listener used to delegate events to the recycler view. */ inner class ScaleListener : ScaleGestureDetector.SimpleOnScaleGestureListener() { - override fun onScaleBegin(detector: ScaleGestureDetector?): Boolean { + override fun onScaleBegin(detector: ScaleGestureDetector): Boolean { recycler?.onScaleBegin() return true } @@ -63,13 +63,13 @@ class WebtoonFrame(context: Context) : FrameLayout(context) { * Fling listener used to delegate events to the recycler view. */ inner class FlingListener : GestureDetector.SimpleOnGestureListener() { - override fun onDown(e: MotionEvent?): Boolean { + override fun onDown(e: MotionEvent): Boolean { return true } override fun onFling( - e1: MotionEvent?, - e2: MotionEvent?, + e1: MotionEvent, + e2: MotionEvent, velocityX: Float, velocityY: Float, ): Boolean { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt index 3c1de2a57..69bbc0f81 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsMainController.kt @@ -102,13 +102,13 @@ class SettingsMainController : SettingsController() { searchItem.setOnActionExpandListener( object : MenuItem.OnActionExpandListener { - override fun onMenuItemActionExpand(item: MenuItem?): Boolean { + override fun onMenuItemActionExpand(item: MenuItem): Boolean { preferences.lastSearchQuerySearchSettings().set("") // reset saved search query router.pushController(SettingsSearchController().withFadeTransaction()) return true } - override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { + override fun onMenuItemActionCollapse(item: MenuItem): Boolean { return true } }, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchController.kt index 462042abc..7d1049032 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/search/SettingsSearchController.kt @@ -74,11 +74,11 @@ class SettingsSearchController : searchItem.setOnActionExpandListener( object : MenuItem.OnActionExpandListener { - override fun onMenuItemActionExpand(item: MenuItem?): Boolean { + override fun onMenuItemActionExpand(item: MenuItem): Boolean { return true } - override fun onMenuItemActionCollapse(item: MenuItem?): Boolean { + override fun onMenuItemActionCollapse(item: MenuItem): Boolean { router.popCurrentController() return false } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt index 794df9097..0ba84840a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/webview/WebViewActivity.kt @@ -166,12 +166,12 @@ class WebViewActivity : BaseActivity() { menu.findItem(R.id.action_web_back).apply { isEnabled = binding.webview.canGoBack() - icon.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor) + icon?.setTint(if (binding.webview.canGoBack()) iconTintColor else translucentIconTintColor) } menu.findItem(R.id.action_web_forward).apply { isEnabled = binding.webview.canGoForward() - icon.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor) + icon?.setTint(if (binding.webview.canGoForward()) iconTintColor else translucentIconTintColor) } return super.onPrepareOptionsMenu(menu) 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 169dad27f..190fd72e4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/TachiyomiBottomNavigationView.kt @@ -115,12 +115,13 @@ class TachiyomiBottomNavigationView @JvmOverloads constructor( .setInterpolator(interpolator) .setDuration(duration) .applySystemAnimatorScale(context) - .setListener(object : AnimatorListenerAdapter() { - override fun onAnimationEnd(animation: Animator?) { - currentAnimator = null - postInvalidate() - } - }, + .setListener( + object : AnimatorListenerAdapter() { + override fun onAnimationEnd(animation: Animator) { + currentAnimator = null + postInvalidate() + } + }, ) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt index e8769990a..576859fe6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/preference/ThemesPreference.kt @@ -37,12 +37,13 @@ class ThemesPreference @JvmOverloads constructor(context: Context, attrs: Attrib recycler?.adapter = adapter // Retain scroll position on activity recreate after changing theme - recycler?.addOnScrollListener(object : RecyclerView.OnScrollListener() { - override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { - super.onScrolled(recyclerView, dx, dy) - lastScrollPosition = recyclerView.computeHorizontalScrollOffset() - } - }, + recycler?.addOnScrollListener( + object : RecyclerView.OnScrollListener() { + override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { + super.onScrolled(recyclerView, dx, dy) + lastScrollPosition = recyclerView.computeHorizontalScrollOffset() + } + }, ) lastScrollPosition?.let { scrollToOffset(it) } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt index f72eb3112..91b710757 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/sheet/BottomSheetViewPager.kt @@ -45,11 +45,12 @@ class BottomSheetViewPager @JvmOverloads constructor( } init { - addOnPageChangeListener(object : SimpleOnPageChangeListener() { - override fun onPageSelected(position: Int) { - requestLayout() - } - }, + addOnPageChangeListener( + object : SimpleOnPageChangeListener() { + override fun onPageSelected(position: Int) { + requestLayout() + } + }, ) } } diff --git a/buildSrc/src/main/kotlin/AndroidConfig.kt b/buildSrc/src/main/kotlin/AndroidConfig.kt index ccf121dc2..f0cf6fc23 100644 --- a/buildSrc/src/main/kotlin/AndroidConfig.kt +++ b/buildSrc/src/main/kotlin/AndroidConfig.kt @@ -1,5 +1,5 @@ object AndroidConfig { - const val compileSdk = 32 + const val compileSdk = 33 const val minSdk = 23 const val targetSdk = 29 const val ndk = "22.1.7171670" diff --git a/gradle/androidx.versions.toml b/gradle/androidx.versions.toml index 867b9d2b4..f9a7c210e 100644 --- a/gradle/androidx.versions.toml +++ b/gradle/androidx.versions.toml @@ -1,6 +1,6 @@ [versions] agp_version = "7.2.2" -lifecycle_version = "2.5.0" +lifecycle_version = "2.5.1" [libraries] annotation = "androidx.annotation:annotation:1.4.0" @@ -10,7 +10,7 @@ constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0" corektx = "androidx.core:core-ktx:1.8.0" splashscreen = "androidx.core:core-splashscreen:1.0.0-alpha02" -recyclerview = "androidx.recyclerview:recyclerview:1.3.0-beta01" +recyclerview = "androidx.recyclerview:recyclerview:1.3.0-beta02" swiperefreshlayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01" viewpager = "androidx.viewpager:viewpager:1.1.0-alpha01" @@ -27,4 +27,4 @@ workmanager = ["work-runtime", "guava"] [plugins] application = { id = "com.android.application", version.ref = "agp_version" } -library = { id = "com.android.library", version.ref = "agp_version" } \ No newline at end of file +library = { id = "com.android.library", version.ref = "agp_version" } diff --git a/gradle/kotlinx.versions.toml b/gradle/kotlinx.versions.toml index 268e66b5f..8d3cce7c1 100644 --- a/gradle/kotlinx.versions.toml +++ b/gradle/kotlinx.versions.toml @@ -1,7 +1,7 @@ [versions] -kotlin_version = "1.6.20" -coroutines_version = "1.6.1" -serialization_version = "1.3.2" +kotlin_version = "1.7.10" +coroutines_version = "1.6.4" +serialization_version = "1.3.3" [libraries] reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin_version" } @@ -12,12 +12,11 @@ coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-androi serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization_version" } serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "serialization_version" } -serialization-gradle = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin_version"} +serialization-gradle = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin_version" } [bundles] coroutines = ["coroutines-core", "coroutines-android"] -serialization = ["serialization-json","serialization-protobuf"] +serialization = ["serialization-json", "serialization-protobuf"] [plugins] - -android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin_version"} \ No newline at end of file +android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin_version" } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 417351534..0e1b8a7a2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,14 +2,15 @@ aboutlib_version = "8.9.4" okhttp_version = "4.10.0" nucleus_version = "3.0.0" -coil_version = "2.0.0-rc03" -conductor_version = "3.1.5" +coil_version = "2.1.0" +conductor_version = "3.1.7" flowbinding_version = "1.2.0" shizuku_version = "12.1.0" +leakcanary = "2.9.1" [libraries] android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2" -google-services-gradle = "com.google.gms:google-services:4.3.10" +google-services-gradle = "com.google.gms:google-services:4.3.13" tachiyomi-api = "org.tachiyomi:source-api:1.1" @@ -33,13 +34,13 @@ jsoup = "org.jsoup:jsoup:1.14.3" disklrucache = "com.jakewharton:disklrucache:2.0.2" unifile = "com.github.tachiyomiorg:unifile:17bec43" -junrar = "com.github.junrar:junrar:7.5.2" +junrar = "com.github.junrar:junrar:7.5.3" -sqlitektx = "androidx.sqlite:sqlite-ktx:2.3.0-alpha02" +sqlitektx = "androidx.sqlite:sqlite-ktx:2.3.0-alpha03" sqlite-android = "com.github.requery:sqlite-android:3.36.0" preferencektx = "androidx.preference:preference-ktx:1.2.0" -flowpreferences = "com.fredporciuncula:flow-preferences:1.7.0" +flowpreferences = "com.fredporciuncula:flow-preferences:1.8.0" nucleus-core = { module = "info.android15.nucleus:nucleus", version.ref = "nucleus_version" } nucleus-supportv7 = { module = "info.android15.nucleus:nucleus-support-v7", version.ref = "nucleus_version" } @@ -77,8 +78,8 @@ flowbinding-viewpager = { module = "io.github.reactivecircus.flowbinding:flowbin logcat = "com.squareup.logcat:logcat:0.1" -acra-http = "ch.acra:acra-http:5.9.5" -firebase-analytics = "com.google.firebase:firebase-analytics-ktx:21.0.0" +acra-http = "ch.acra:acra-http:5.9.6" +firebase-analytics = "com.google.firebase:firebase-analytics-ktx:21.1.0" aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutlib_version" } aboutlibraries-gradle = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "aboutlib_version" } @@ -86,21 +87,22 @@ aboutlibraries-gradle = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibr shizuku-api = { module = "dev.rikka.shizuku:api", version.ref = "shizuku_version" } shizuku-provider = { module = "dev.rikka.shizuku:provider", version.ref = "shizuku_version" } +leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" } +leakcanary-plumber = { module = "com.squareup.leakcanary:plumber-android", version.ref = "leakcanary" } + junit = "org.junit.jupiter:junit-jupiter:5.9.0" -leakcanary-android = "com.squareup.leakcanary:leakcanary-android:2.7" - [bundles] -reactivex = ["rxandroid","rxjava","rxrelay"] -okhttp = ["okhttp-core","okhttp-logging","okhttp-dnsoverhttps"] +reactivex = ["rxandroid", "rxjava", "rxrelay"] +okhttp = ["okhttp-core", "okhttp-logging", "okhttp-dnsoverhttps"] js-engine = ["quickjs-android", "duktape-android"] sqlite = ["sqlitektx", "sqlite-android"] -nucleus = ["nucleus-core","nucleus-supportv7"] -coil = ["coil-core","coil-gif",] -flowbinding = ["flowbinding-android","flowbinding-appcompat","flowbinding-recyclerview","flowbinding-swiperefreshlayout","flowbinding-viewpager"] -conductor = ["conductor-core","conductor-viewpager","conductor-support-preference"] -shizuku = ["shizuku-api","shizuku-provider"] +nucleus = ["nucleus-core", "nucleus-supportv7"] +coil = ["coil-core", "coil-gif"] +flowbinding = ["flowbinding-android", "flowbinding-appcompat", "flowbinding-recyclerview", "flowbinding-swiperefreshlayout", "flowbinding-viewpager"] +conductor = ["conductor-core", "conductor-viewpager", "conductor-support-preference"] +shizuku = ["shizuku-api", "shizuku-provider"] [plugins] -kotlinter = { id = "org.jmailen.kotlinter", version = "3.10.0"} -versionsx = { id = "com.github.ben-manes.versions", version = "0.42.0"} \ No newline at end of file +kotlinter = { id = "org.jmailen.kotlinter", version = "3.11.1" } +versionsx = { id = "com.github.ben-manes.versions", version = "0.42.0" } \ No newline at end of file