From 3956423f2fae2ee524a318118d2c638a29fdc4c1 Mon Sep 17 00:00:00 2001 From: Mohamed Date: Thu, 16 Jul 2020 16:40:08 +0200 Subject: [PATCH] refactor to Rxjava3 --- app/build.gradle | 6 +++--- app/src/main/java/app/OnPreResultActivity.java | 2 +- rx_activity_result/build.gradle | 8 ++++---- .../rx_activity_result2/ActivitiesLifecycleCallbacks.java | 7 ++++--- .../src/main/java/rx_activity_result2/HolderActivity.java | 3 ++- .../src/main/java/rx_activity_result2/OnPreResult.java | 4 +++- .../main/java/rx_activity_result2/RxActivityResult.java | 6 +++--- 7 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1ff8af7..06dbf14 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,12 +8,12 @@ buildscript { } android { - compileSdkVersion 28 + compileSdkVersion 30 defaultConfig { applicationId "io.victoralbertos.app" - minSdkVersion 16 - targetSdkVersion 24 + minSdkVersion 21 + targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/app/OnPreResultActivity.java b/app/src/main/java/app/OnPreResultActivity.java index 5e16e5f..bf7e2f2 100644 --- a/app/src/main/java/app/OnPreResultActivity.java +++ b/app/src/main/java/app/OnPreResultActivity.java @@ -6,7 +6,7 @@ import android.view.View; import android.widget.TextView; import app.multi_start.FirstActivity; -import io.reactivex.Observable; +import io.reactivex.rxjava3.core.Observable; import io.victoralbertos.app.R; import rx_activity_result2.RxActivityResult; diff --git a/rx_activity_result/build.gradle b/rx_activity_result/build.gradle index fe563c7..13dfa5b 100644 --- a/rx_activity_result/build.gradle +++ b/rx_activity_result/build.gradle @@ -4,11 +4,11 @@ group='com.github.VictorAlbertos' version='0.4.4-2.x' android { - compileSdkVersion 28 + compileSdkVersion 30 defaultConfig { - minSdkVersion 16 - targetSdkVersion 25 + minSdkVersion 21 + targetSdkVersion 30 versionCode 1 versionName "1.0" } @@ -22,7 +22,7 @@ android { dependencies { api "androidx.fragment:fragment:1.0.0" - api "io.reactivex.rxjava2:rxjava:2.2.3" + api "io.reactivex.rxjava3:rxjava:3.0.4" testImplementation 'junit:junit:4.12' } diff --git a/rx_activity_result/src/main/java/rx_activity_result2/ActivitiesLifecycleCallbacks.java b/rx_activity_result/src/main/java/rx_activity_result2/ActivitiesLifecycleCallbacks.java index 38b3384..60db0bc 100644 --- a/rx_activity_result/src/main/java/rx_activity_result2/ActivitiesLifecycleCallbacks.java +++ b/rx_activity_result/src/main/java/rx_activity_result2/ActivitiesLifecycleCallbacks.java @@ -5,9 +5,10 @@ import android.os.Bundle; import androidx.annotation.Nullable; -import io.reactivex.Observable; -import io.reactivex.functions.Function; -import io.reactivex.functions.Predicate; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.functions.*; + + import java.util.concurrent.TimeUnit; class ActivitiesLifecycleCallbacks { diff --git a/rx_activity_result/src/main/java/rx_activity_result2/HolderActivity.java b/rx_activity_result/src/main/java/rx_activity_result2/HolderActivity.java index f252ed1..ce4f073 100644 --- a/rx_activity_result/src/main/java/rx_activity_result2/HolderActivity.java +++ b/rx_activity_result/src/main/java/rx_activity_result2/HolderActivity.java @@ -22,7 +22,8 @@ import android.content.IntentSender; import android.os.Bundle; -import io.reactivex.functions.Action; +import io.reactivex.rxjava3.functions.Action; + public class HolderActivity extends Activity { private static Request request; diff --git a/rx_activity_result/src/main/java/rx_activity_result2/OnPreResult.java b/rx_activity_result/src/main/java/rx_activity_result2/OnPreResult.java index a45b37e..47ec0db 100644 --- a/rx_activity_result/src/main/java/rx_activity_result2/OnPreResult.java +++ b/rx_activity_result/src/main/java/rx_activity_result2/OnPreResult.java @@ -2,7 +2,9 @@ import android.content.Intent; import androidx.annotation.Nullable; -import io.reactivex.Observable; + +import io.reactivex.rxjava3.core.Observable; + public interface OnPreResult { Observable response(int requestCode, int resultCode, @Nullable Intent data); diff --git a/rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java b/rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java index 1b562f1..c8f7cfe 100644 --- a/rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java +++ b/rx_activity_result/src/main/java/rx_activity_result2/RxActivityResult.java @@ -28,9 +28,9 @@ import java.util.List; -import io.reactivex.Observable; -import io.reactivex.functions.Consumer; -import io.reactivex.subjects.PublishSubject; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.functions.Consumer; +import io.reactivex.rxjava3.subjects.PublishSubject; public final class RxActivityResult {