From 4a7fda95aee59cd9a1ef4444ab8d84570205f8dc Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Tue, 31 Oct 2023 21:25:11 -0400 Subject: [PATCH] Update miscellaneous libraries --- app/build.gradle | 19 +++++++------------ .../org/schabi/newpipe/database/Converters.kt | 2 +- .../local/feed/service/FeedEventManager.kt | 2 +- .../subscription/dialog/FeedGroupDialog.kt | 10 +++++----- .../dialog/FeedGroupDialogViewModel.kt | 4 ++-- .../local/subscription/FeedGroupIconTest.kt | 4 ++-- build.gradle | 4 ++-- 7 files changed, 20 insertions(+), 25 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d6b49f232..3705776b6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -118,7 +118,6 @@ ext { leakCanaryVersion = '2.12' stethoVersion = '1.6.0' - mockitoVersion = '4.0.0' } configurations { @@ -237,13 +236,10 @@ dependencies { kapt "frankiesardo:icepick-processor:${icepickVersion}" // HTML parser - implementation "org.jsoup:jsoup:1.16.1" + implementation "org.jsoup:jsoup:1.16.2" // HTTP client - implementation "com.squareup.okhttp3:okhttp:4.11.0" - // okhttp3:4.11.0 introduces a vulnerability from com.squareup.okio:okio@3.3.0, - // remove com.squareup.okio:okio when updating okhttp - implementation "com.squareup.okio:okio:3.4.0" + implementation "com.squareup.okhttp3:okhttp:4.12.0" // Media player implementation "com.google.android.exoplayer:exoplayer-core:${exoPlayerVersion}" @@ -272,19 +268,19 @@ dependencies { implementation "io.noties.markwon:linkify:${markwonVersion}" // Crash reporting - implementation "ch.acra:acra-core:5.10.1" + implementation "ch.acra:acra-core:5.11.3" // Properly restarting implementation 'com.jakewharton:process-phoenix:2.1.2' // Reactive extensions for Java VM - implementation "io.reactivex.rxjava3:rxjava:3.1.6" + implementation "io.reactivex.rxjava3:rxjava:3.1.8" implementation "io.reactivex.rxjava3:rxandroid:3.0.2" // RxJava binding APIs for Android UI widgets implementation "com.jakewharton.rxbinding4:rxbinding:4.0.0" // Date and time formatting - implementation "org.ocpsoft.prettytime:prettytime:5.0.6.Final" + implementation "org.ocpsoft.prettytime:prettytime:5.0.7.Final" /** Debugging **/ // Memory leak detection @@ -297,13 +293,12 @@ dependencies { /** Testing **/ testImplementation 'junit:junit:4.13.2' - testImplementation "org.mockito:mockito-core:${mockitoVersion}" - testImplementation "org.mockito:mockito-inline:${mockitoVersion}" + testImplementation 'org.mockito:mockito-core:5.6.0' androidTestImplementation "androidx.test.ext:junit:1.1.5" androidTestImplementation "androidx.test:runner:1.5.2" androidTestImplementation "androidx.room:room-testing:${androidxRoomVersion}" - androidTestImplementation "org.assertj:assertj-core:3.23.1" + androidTestImplementation "org.assertj:assertj-core:3.24.2" } static String getGitWorkingBranch() { diff --git a/app/src/main/java/org/schabi/newpipe/database/Converters.kt b/app/src/main/java/org/schabi/newpipe/database/Converters.kt index 0eafcede1..6f705a5e4 100644 --- a/app/src/main/java/org/schabi/newpipe/database/Converters.kt +++ b/app/src/main/java/org/schabi/newpipe/database/Converters.kt @@ -47,6 +47,6 @@ object Converters { @TypeConverter fun feedGroupIconOf(id: Int): FeedGroupIcon { - return FeedGroupIcon.values().first { it.id == id } + return FeedGroupIcon.entries.first { it.id == id } } } diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedEventManager.kt b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedEventManager.kt index 3d19de9c6..1c2826e7a 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedEventManager.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/service/FeedEventManager.kt @@ -26,7 +26,7 @@ object FeedEventManager { } sealed class Event { - object IdleEvent : Event() + data object IdleEvent : Event() data class ProgressEvent(val currentProgress: Int = -1, val maxProgress: Int = -1, @StringRes val progressMessage: Int = 0) : Event() { constructor(@StringRes progressMessage: Int) : this(-1, -1, progressMessage) } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt index 19c581c08..41761fb01 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialog.kt @@ -55,10 +55,10 @@ class FeedGroupDialog : DialogFragment(), BackPressable { private var groupSortOrder: Long = -1 sealed class ScreenState : Serializable { - object InitialScreen : ScreenState() - object IconPickerScreen : ScreenState() - object SubscriptionsPickerScreen : ScreenState() - object DeleteScreen : ScreenState() + data object InitialScreen : ScreenState() + data object IconPickerScreen : ScreenState() + data object SubscriptionsPickerScreen : ScreenState() + data object DeleteScreen : ScreenState() } @State @JvmField var selectedIcon: FeedGroupIcon? = null @@ -370,7 +370,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable { private fun setupIconPicker() { val groupAdapter = GroupieAdapter() - groupAdapter.addAll(FeedGroupIcon.values().map { PickerIconItem(it) }) + groupAdapter.addAll(FeedGroupIcon.entries.map { PickerIconItem(it) }) feedGroupCreateBinding.iconSelector.apply { layoutManager = GridLayoutManager(requireContext(), 7, RecyclerView.VERTICAL, false) diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialogViewModel.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialogViewModel.kt index eff1a4400..292bda394 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialogViewModel.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/dialog/FeedGroupDialogViewModel.kt @@ -110,8 +110,8 @@ class FeedGroupDialogViewModel( } sealed class DialogEvent { - object ProcessingEvent : DialogEvent() - object SuccessEvent : DialogEvent() + data object ProcessingEvent : DialogEvent() + data object SuccessEvent : DialogEvent() } data class Filter(val query: String, val showOnlyUngrouped: Boolean) diff --git a/app/src/test/java/org/schabi/newpipe/local/subscription/FeedGroupIconTest.kt b/app/src/test/java/org/schabi/newpipe/local/subscription/FeedGroupIconTest.kt index 1479c3d1e..2fc44d9b7 100644 --- a/app/src/test/java/org/schabi/newpipe/local/subscription/FeedGroupIconTest.kt +++ b/app/src/test/java/org/schabi/newpipe/local/subscription/FeedGroupIconTest.kt @@ -9,7 +9,7 @@ class FeedGroupIconTest { fun `No gaps and repeated ids`() { val usedIds = HashSet() - for ((shouldBeId, currentIcon) in FeedGroupIcon.values().withIndex()) { + for ((shouldBeId, currentIcon) in FeedGroupIcon.entries.withIndex()) { val added = usedIds.add(currentIcon.id) assertTrue("Repeated ids (current item: ${currentIcon.name} - ${currentIcon.id})", added) @@ -24,7 +24,7 @@ class FeedGroupIconTest { fun `No icons pointing to the same attr`() { val usedIcons = HashSet() - for (groupIcon in FeedGroupIcon.values()) { + for (groupIcon in FeedGroupIcon.entries) { val added = usedIcons.add(groupIcon.drawableResource) assertTrue("Repeated icon (current item: ${groupIcon.name} - ${groupIcon.id})", added) } diff --git a/build.gradle b/build.gradle index f1c861c9f..2f3d292bb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.8.22' + ext.kotlin_version = '1.9.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'com.android.tools.build:gradle:8.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong