From dc23ea23d101b017627a5da4b1c544f77e1ce0b1 Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Sun, 3 Mar 2024 17:38:32 +0100 Subject: [PATCH] refactor: Remove last vestiges of rxJava (#492) --- app/build.gradle.kts | 5 ----- app/proguard-rules.pro | 1 - app/src/main/java/app/pachli/MainActivity.kt | 1 + app/src/main/java/app/pachli/PachliApplication.kt | 8 -------- gradle/libs.versions.toml | 9 --------- 5 files changed, 1 insertion(+), 23 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3e4330265..c2faf843e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -131,7 +131,6 @@ dependencies { implementation(projects.feature.login) implementation(libs.kotlinx.coroutines.android) - implementation(libs.kotlinx.coroutines.rx3) implementation(libs.bundles.androidx) @@ -150,10 +149,6 @@ dependencies { implementation(libs.bundles.glide) ksp(libs.glide.compiler) - implementation(libs.bundles.rxjava3) - - implementation(libs.bundles.autodispose) - implementation(libs.sparkbutton) implementation(libs.touchimageview) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 39b5f9edf..5b300f2ac 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -58,7 +58,6 @@ -keepnames class * # Retain generic signatures of classes used in MastodonApi so Retrofit works --keep,allowobfuscation,allowshrinking class io.reactivex.rxjava3.core.Single -keep,allowobfuscation,allowshrinking class retrofit2.Response -keep,allowobfuscation,allowshrinking class kotlin.collections.List -keep,allowobfuscation,allowshrinking class kotlin.collections.Map diff --git a/app/src/main/java/app/pachli/MainActivity.kt b/app/src/main/java/app/pachli/MainActivity.kt index f090b6fae..b8bbd0301 100644 --- a/app/src/main/java/app/pachli/MainActivity.kt +++ b/app/src/main/java/app/pachli/MainActivity.kt @@ -979,6 +979,7 @@ class MainActivity : BottomSheetActivity(), ActionButtonActivity, MenuProvider { } updateProfiles() + externalScope.launch { updateShortcut(applicationContext, accountManager.activeAccount!!) } diff --git a/app/src/main/java/app/pachli/PachliApplication.kt b/app/src/main/java/app/pachli/PachliApplication.kt index e2b330e9b..1d1c6e48c 100644 --- a/app/src/main/java/app/pachli/PachliApplication.kt +++ b/app/src/main/java/app/pachli/PachliApplication.kt @@ -38,12 +38,10 @@ import app.pachli.util.setAppNightMode import app.pachli.worker.PruneCacheWorker import app.pachli.worker.PruneLogEntryEntityWorker import app.pachli.worker.WorkerFactory -import autodispose2.AutoDisposePlugins import dagger.hilt.android.HiltAndroidApp import de.c1710.filemojicompat_defaults.DefaultEmojiPackList import de.c1710.filemojicompat_ui.helpers.EmojiPackHelper import de.c1710.filemojicompat_ui.helpers.EmojiPreference -import io.reactivex.rxjava3.plugins.RxJavaPlugins import java.security.Security import java.util.concurrent.TimeUnit import javax.inject.Inject @@ -85,8 +83,6 @@ class PachliApplication : Application() { Security.insertProviderAt(Conscrypt.newProvider(), 1) - AutoDisposePlugins.setHideProxies(false) // a small performance optimization - when { BuildConfig.DEBUG -> Timber.plant(Timber.DebugTree()) BuildConfig.FLAVOR_color == "orange" -> Timber.plant(TreeRing) @@ -110,10 +106,6 @@ class PachliApplication : Application() { localeManager.setLocale() - RxJavaPlugins.setErrorHandler { - Timber.tag("RxJava").w(it, "undeliverable exception") - } - createWorkerNotificationChannel(this) WorkManager.initialize( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 13f39617e..76836b698 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -59,7 +59,6 @@ quadrant = "1.9.1" retrofit = "2.9.0" robolectric = "4.11.1" rxandroid3 = "3.0.2" -rxjava3 = "3.1.8" rxkotlin3 = "3.0.1" semver = "1.4.2" sparkbutton = "4.1.0" @@ -136,8 +135,6 @@ androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "androidx-work" } app-update = { module = "com.google.android.play:app-update", version.ref = "app-update" } app-update-ktx = { module = "com.google.android.play:app-update-ktx", version.ref = "app-update" } -autodispose-android-lifecycle = { module = "com.uber.autodispose2:autodispose-androidx-lifecycle", version.ref = "autodispose" } -autodispose-core = { module = "com.uber.autodispose2:autodispose", version.ref = "autodispose" } auto-service-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "auto-service"} auto-service-ksp = { module = "dev.zacsweers.autoservice:auto-service-ksp", version.ref = "auto-service-ksp"} bouncycastle = { module = "org.bouncycastle:bcprov-jdk15on", version.ref = "bouncycastle" } @@ -159,7 +156,6 @@ junit = { module = "junit:junit", version.ref = "junit" } kotlin-result = { module = "com.michael-bull.kotlin-result:kotlin-result", version.ref = "kotlin-result" } kotlin-result-coroutines = { module = "com.michael-bull.kotlin-result:kotlin-result-coroutines", version.ref = "kotlin-result" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } -kotlinx-coroutines-rx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "coroutines" } kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } image-cropper = { module = "com.github.CanHub:Android-Image-Cropper", version.ref = "image-cropper" } @@ -183,9 +179,6 @@ okhttp-logging-interceptor = { module = "com.squareup.okhttp3:logging-intercepto retrofit-converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" } retrofit-core = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" } -rxjava3-android = { module = "io.reactivex.rxjava3:rxandroid", version.ref = "rxandroid3" } -rxjava3-core = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava3" } -rxjava3-kotlin = { module = "io.reactivex.rxjava3:rxkotlin", version.ref = "rxkotlin3" } semver = { module = "io.github.z4kn4fein:semver", version.ref = "semver" } sparkbutton = { module = "com.github.connyduck:sparkbutton", version.ref = "sparkbutton" } timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } @@ -211,7 +204,6 @@ androidx = ["androidx-core-ktx", "androidx-appcompat", "androidx-fragment-ktx", "androidx-core-splashscreen", "androidx-activity", "androidx-media3-exoplayer", "androidx-media3-exoplayer-dash", "androidx-media3-exoplayer-hls", "androidx-media3-exoplayer-rtsp", "androidx-media3-datasource-okhttp", "androidx-media3-ui", "android-material"] -autodispose = ["autodispose-core", "autodispose-android-lifecycle"] filemojicompat = ["filemojicompat-core", "filemojicompat-ui", "filemojicompat-defaults"] glide = ["glide-core", "glide-okhttp3-integration", "glide-animation-plugin"] lint-api = ["kotlin-stdlib", "lint-api", "lint-checks"] @@ -221,5 +213,4 @@ mockito = ["mockito-kotlin", "mockito-inline"] okhttp = ["okhttp-core", "okhttp-logging-interceptor"] retrofit = ["retrofit-core", "retrofit-converter-moshi"] room = ["androidx-room-ktx", "androidx-room-paging"] -rxjava3 = ["rxjava3-core", "rxjava3-android", "rxjava3-kotlin"] xmldiff = ["diffx", "xmlwriter"]