From a59e1628e1768d4efd3bb6715533910b4ff3bfe8 Mon Sep 17 00:00:00 2001 From: Guillaume HUSTA Date: Wed, 26 May 2021 12:33:28 +0200 Subject: [PATCH] FIX #226 : Upgrade to RxJava 3 --- app/build.gradle | 6 +++--- .../java/fr/husta/android/dockersearch/MainActivity.java | 8 ++++---- .../fr/husta/android/dockersearch/TagListActivity.java | 8 ++++---- .../android/dockersearch/docker/DockerRegistryClient.java | 8 ++++---- .../dockersearch/docker/DockerSearchRestService.java | 2 +- .../dockersearch/docker/DockerRegistryClientTest.java | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5c887fe..0cacc03 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -80,11 +80,11 @@ dependencies { implementation 'com.google.android.material:material:1.3.0' implementation 'org.apache.commons:commons-lang3:3.12.0' - implementation 'io.reactivex.rxjava2:rxjava:2.2.21' - implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' + implementation 'io.reactivex.rxjava3:rxjava:3.0.12' + implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-jackson:2.9.0' - implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0' + implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0' implementation 'com.squareup.okhttp3:okhttp:4.9.1' implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3' implementation 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.12.3' diff --git a/app/src/main/java/fr/husta/android/dockersearch/MainActivity.java b/app/src/main/java/fr/husta/android/dockersearch/MainActivity.java index d5b7c19..7185b86 100644 --- a/app/src/main/java/fr/husta/android/dockersearch/MainActivity.java +++ b/app/src/main/java/fr/husta/android/dockersearch/MainActivity.java @@ -39,10 +39,10 @@ import fr.husta.android.dockersearch.listadapter.DockerImageExpandableListAdapter; import fr.husta.android.dockersearch.search.RecentSearchProvider; import fr.husta.android.dockersearch.utils.AppInfo; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.CompositeDisposable; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; +import io.reactivex.rxjava3.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.schedulers.Schedulers; import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY; import static androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM; diff --git a/app/src/main/java/fr/husta/android/dockersearch/TagListActivity.java b/app/src/main/java/fr/husta/android/dockersearch/TagListActivity.java index f68927d..95fbac1 100644 --- a/app/src/main/java/fr/husta/android/dockersearch/TagListActivity.java +++ b/app/src/main/java/fr/husta/android/dockersearch/TagListActivity.java @@ -23,10 +23,10 @@ import fr.husta.android.dockersearch.docker.DockerRegistryClient; import fr.husta.android.dockersearch.docker.model.RepositoryTagV2; import fr.husta.android.dockersearch.listadapter.DockerTagListAdapter; -import io.reactivex.android.schedulers.AndroidSchedulers; -import io.reactivex.disposables.CompositeDisposable; -import io.reactivex.disposables.Disposable; -import io.reactivex.schedulers.Schedulers; +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; +import io.reactivex.rxjava3.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.Disposable; +import io.reactivex.rxjava3.schedulers.Schedulers; public class TagListActivity extends AppCompatActivity implements SwipeRefreshLayout.OnRefreshListener diff --git a/app/src/main/java/fr/husta/android/dockersearch/docker/DockerRegistryClient.java b/app/src/main/java/fr/husta/android/dockersearch/docker/DockerRegistryClient.java index d28b56b..6aeacc3 100644 --- a/app/src/main/java/fr/husta/android/dockersearch/docker/DockerRegistryClient.java +++ b/app/src/main/java/fr/husta/android/dockersearch/docker/DockerRegistryClient.java @@ -10,10 +10,10 @@ import fr.husta.android.dockersearch.AppConstants; import fr.husta.android.dockersearch.docker.model.ContainerImageSearchResult; import fr.husta.android.dockersearch.docker.model.ContainerRepositoryTagV2; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import okhttp3.OkHttpClient; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; +import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory; import retrofit2.converter.jackson.JacksonConverterFactory; public class DockerRegistryClient @@ -49,7 +49,7 @@ public DockerRegistryClient() .readTimeout(30, TimeUnit.SECONDS) .build()) .addConverterFactory(JacksonConverterFactory.create(objectMapper)) - .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) .build(); retrofitRxJava2 = new Retrofit.Builder() @@ -59,7 +59,7 @@ public DockerRegistryClient() .readTimeout(30, TimeUnit.SECONDS) .build()) .addConverterFactory(JacksonConverterFactory.create(objectMapper)) - .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) .build(); } diff --git a/app/src/main/java/fr/husta/android/dockersearch/docker/DockerSearchRestService.java b/app/src/main/java/fr/husta/android/dockersearch/docker/DockerSearchRestService.java index 9c6d8a3..88c1251 100644 --- a/app/src/main/java/fr/husta/android/dockersearch/docker/DockerSearchRestService.java +++ b/app/src/main/java/fr/husta/android/dockersearch/docker/DockerSearchRestService.java @@ -5,7 +5,7 @@ import fr.husta.android.dockersearch.docker.model.ContainerImageSearchResult; import fr.husta.android.dockersearch.docker.model.ContainerRepositoryTagV2; import fr.husta.android.dockersearch.docker.model.RepositoryTag; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import retrofit2.Call; import retrofit2.http.GET; import retrofit2.http.Path; diff --git a/app/src/test/java/fr/husta/android/dockersearch/docker/DockerRegistryClientTest.java b/app/src/test/java/fr/husta/android/dockersearch/docker/DockerRegistryClientTest.java index e01aae8..f3de2a7 100644 --- a/app/src/test/java/fr/husta/android/dockersearch/docker/DockerRegistryClientTest.java +++ b/app/src/test/java/fr/husta/android/dockersearch/docker/DockerRegistryClientTest.java @@ -8,8 +8,8 @@ import fr.husta.android.dockersearch.docker.model.ContainerImageSearchResult; import fr.husta.android.dockersearch.docker.model.ContainerRepositoryTagV2; import fr.husta.android.dockersearch.docker.model.RepositoryTagV2; -import io.reactivex.Observable; -import io.reactivex.disposables.Disposable; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.disposables.Disposable; import static com.google.common.truth.Truth.assertThat;