From 036efd7c4b00a58217a2a22662241ce312b2ccd2 Mon Sep 17 00:00:00 2001 From: Dan Lew Date: Thu, 25 Oct 2018 10:24:12 -0500 Subject: [PATCH] Upgraded to AndroidX --- build.gradle | 10 +++++----- .../src/main/AndroidManifest.xml | 3 +-- .../android/lifecycle/kotlin/rxlifecycle.kt | 4 ++-- rxlifecycle-android-lifecycle/build.gradle | 6 +++--- .../android/lifecycle/AndroidLifecycle.java | 13 +++++++------ .../lifecycle/RxLifecycleAndroidLifecycle.java | 7 +++---- .../com/trello/rxlifecycle2/RxLifecycleTest.java | 3 +-- .../lifecycle/AndroidLifecycleActivityTest.java | 14 ++++++++------ .../lifecycle/AndroidLifecycleFragmentTest.java | 16 +++++++++------- .../rxlifecycle2/android/RxLifecycleAndroid.java | 6 ++++-- .../android/ViewDetachesOnSubscribe.java | 1 + .../com/trello/rxlifecycle2/RxLifecycleTest.java | 11 +++++++---- ...RxEditTextPreferenceDialogFragmentCompat.java | 12 +++++++----- .../RxListPreferenceDialogFragmentCompat.java | 12 +++++++----- .../RxPreferenceDialogFragmentCompat.java | 12 +++++++----- .../preference/RxPreferenceFragmentCompat.java | 10 +++++----- .../RxPreferenceFragmentLifecycleTest.java | 13 ++++++++----- .../rxlifecycle2/components/RxActivity.java | 10 ++++++---- .../components/RxDialogFragment.java | 10 ++++++---- .../rxlifecycle2/components/RxFragment.java | 10 ++++++---- .../components/RxPreferenceFragment.java | 10 ++++++---- .../components/support/RxAppCompatActivity.java | 12 +++++++----- .../support/RxAppCompatDialogFragment.java | 12 +++++++----- .../components/support/RxDialogFragment.java | 12 +++++++----- .../components/support/RxFragment.java | 10 ++++++---- .../components/support/RxFragmentActivity.java | 12 +++++++----- .../components/RxActivityLifecycleTest.java | 8 +++++--- .../components/RxFragmentLifecycleTest.java | 9 ++++++--- .../support/RxSupportFragmentLifecycleTest.java | 12 +++++++----- .../navi/ActivityLifecycleProviderImpl.java | 5 +++-- .../navi/FragmentLifecycleProviderImpl.java | 5 +++-- .../trello/rxlifecycle2/navi/NaviLifecycle.java | 5 +++-- .../rxlifecycle2/navi/NaviLifecycleMaps.java | 3 ++- .../components/NaviActivityLifecycleTest.java | 9 ++++++--- .../components/NaviFragmentLifecycleTest.java | 9 ++++++--- .../trello/rxlifecycle2/sample/MainActivity.java | 6 ++++-- .../java/com/trello/rxlifecycle2/Functions.java | 3 ++- .../trello/rxlifecycle2/LifecycleProvider.java | 4 ++-- .../rxlifecycle2/LifecycleTransformer.java | 7 ++++--- .../com/trello/rxlifecycle2/RxLifecycle.java | 6 +++--- .../OutsideLifecycleExceptionTest.java | 3 ++- .../com/trello/rxlifecycle2/RxLifecycleTest.java | 5 +++-- ...espondingEventTransformerCompletableTest.java | 9 +++++---- ...orrespondingEventTransformerFlowableTest.java | 5 +++-- ...ilCorrespondingEventTransformerMaybeTest.java | 5 +++-- ...respondingEventTransformerObservableTest.java | 5 +++-- ...lCorrespondingEventTransformerSingleTest.java | 11 ++++++----- .../UntilEventTransformerCompletableTest.java | 7 ++++--- .../UntilEventTransformerFlowableTest.java | 5 +++-- .../UntilEventTransformerMaybeTest.java | 5 +++-- .../UntilEventTransformerObservableTest.java | 5 +++-- .../UntilEventTransformerSingleTest.java | 9 +++++---- ...UntilLifecycleTransformerCompletableTest.java | 7 ++++--- .../UntilLifecycleTransformerFlowableTest.java | 5 +++-- .../UntilLifecycleTransformerMaybeTest.java | 5 +++-- .../UntilLifecycleTransformerObservableTest.java | 5 +++-- .../UntilLifecycleTransformerSingleTest.java | 9 +++++---- 57 files changed, 260 insertions(+), 187 deletions(-) diff --git a/build.gradle b/build.gradle index 7c37385..f5a765e 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ ext { compileSdkVersion = 28 targetSdkVersion = compileSdkVersion - supportLibVersion = '28.0.0' + supportLibVersion = '1.0.0' lifecycleVersion = '1.1.1' lifecycleRuntimeVersion = '1.1.1' @@ -38,14 +38,14 @@ ext { // Define all dependencies in the base project, to unify & make it easy to update rxJava = 'io.reactivex.rxjava2:rxjava:2.2.3' rxAndroid = 'io.reactivex.rxjava2:rxandroid:2.1.0' - navi = 'com.trello.navi2:navi:2.0.1' + navi = 'com.trello.navi2:navi:2.1.0' lifecycle = "android.arch.lifecycle:runtime:$lifecycleRuntimeVersion" lifecycleProcessor = "android.arch.lifecycle:compiler:$lifecycleVersion" lifecycleExtensions = "android.arch.lifecycle:extensions:$lifecycleVersion" kotlinStdlib = "org.jetbrains.kotlin:kotlin-stdlib:$verKotlin" - appCompat = "com.android.support:appcompat-v7:$supportLibVersion" - preferenceCompat = "com.android.support:preference-v7:$supportLibVersion" - supportAnnotations = "com.android.support:support-annotations:$supportLibVersion" + appCompat = "androidx.appcompat:appcompat:$supportLibVersion" + preferenceCompat = "androidx.preference:preference:$supportLibVersion" + supportAnnotations = "androidx.annotation:annotation:$supportLibVersion" jsr305Annotations = 'com.google.code.findbugs:jsr305:3.0.2' junit = 'junit:junit:4.12' robolectric = 'org.robolectric:robolectric:3.8' diff --git a/rxlifecycle-android-lifecycle-kotlin/src/main/AndroidManifest.xml b/rxlifecycle-android-lifecycle-kotlin/src/main/AndroidManifest.xml index 76d4905..9b9469a 100644 --- a/rxlifecycle-android-lifecycle-kotlin/src/main/AndroidManifest.xml +++ b/rxlifecycle-android-lifecycle-kotlin/src/main/AndroidManifest.xml @@ -1,2 +1 @@ - + diff --git a/rxlifecycle-android-lifecycle-kotlin/src/main/java/com/trello/rxlifecycle2/android/lifecycle/kotlin/rxlifecycle.kt b/rxlifecycle-android-lifecycle-kotlin/src/main/java/com/trello/rxlifecycle2/android/lifecycle/kotlin/rxlifecycle.kt index cb976fe..ad48eaa 100644 --- a/rxlifecycle-android-lifecycle-kotlin/src/main/java/com/trello/rxlifecycle2/android/lifecycle/kotlin/rxlifecycle.kt +++ b/rxlifecycle-android-lifecycle-kotlin/src/main/java/com/trello/rxlifecycle2/android/lifecycle/kotlin/rxlifecycle.kt @@ -14,8 +14,8 @@ package com.trello.rxlifecycle2.android.lifecycle.kotlin -import android.arch.lifecycle.Lifecycle -import android.arch.lifecycle.LifecycleOwner +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner import com.trello.lifecycle2.android.lifecycle.AndroidLifecycle import io.reactivex.* diff --git a/rxlifecycle-android-lifecycle/build.gradle b/rxlifecycle-android-lifecycle/build.gradle index 82871a5..362286f 100644 --- a/rxlifecycle-android-lifecycle/build.gradle +++ b/rxlifecycle-android-lifecycle/build.gradle @@ -20,12 +20,12 @@ dependencies { implementation rootProject.ext.rxAndroid implementation rootProject.ext.supportAnnotations - api rootProject.ext.lifecycle - annotationProcessor rootProject.ext.lifecycleProcessor + api 'androidx.lifecycle:lifecycle-runtime:2.0.0' + annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0' testImplementation rootProject.ext.junit testImplementation rootProject.ext.robolectric - testImplementation rootProject.ext.lifecycleExtensions + testImplementation 'androidx.lifecycle:lifecycle-extensions:2.0.0' } apply from: "$rootDir/gradle/artifacts.gradle" diff --git a/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/AndroidLifecycle.java b/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/AndroidLifecycle.java index 23aa2f9..ca37c76 100644 --- a/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/AndroidLifecycle.java +++ b/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/AndroidLifecycle.java @@ -1,14 +1,15 @@ package com.trello.lifecycle2.android.lifecycle; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleObserver; -import android.arch.lifecycle.LifecycleOwner; -import android.arch.lifecycle.OnLifecycleEvent; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; + +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; +import androidx.lifecycle.LifecycleOwner; +import androidx.lifecycle.OnLifecycleEvent; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/RxLifecycleAndroidLifecycle.java b/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/RxLifecycleAndroidLifecycle.java index f4de5ee..4951536 100644 --- a/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/RxLifecycleAndroidLifecycle.java +++ b/rxlifecycle-android-lifecycle/src/main/java/com/trello/lifecycle2/android/lifecycle/RxLifecycleAndroidLifecycle.java @@ -1,12 +1,11 @@ package com.trello.lifecycle2.android.lifecycle; -import android.arch.lifecycle.Lifecycle; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; - import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.OutsideLifecycleException; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.lifecycle.Lifecycle; import io.reactivex.Observable; import io.reactivex.functions.Function; diff --git a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java index 80078eb..64fb059 100644 --- a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java +++ b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java @@ -1,7 +1,5 @@ package com.trello.rxlifecycle2; -import android.arch.lifecycle.Lifecycle; - import com.trello.lifecycle2.android.lifecycle.RxLifecycleAndroidLifecycle; import org.junit.Before; @@ -10,6 +8,7 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import androidx.lifecycle.Lifecycle; import io.reactivex.Observable; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleActivityTest.java b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleActivityTest.java index 0fad7fb..8025ddc 100644 --- a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleActivityTest.java +++ b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleActivityTest.java @@ -1,13 +1,8 @@ package com.trello.rxlifecycle2.android.lifecycle; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleOwner; -import android.support.v4.app.FragmentActivity; import com.trello.lifecycle2.android.lifecycle.AndroidLifecycle; import com.trello.rxlifecycle2.LifecycleProvider; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,6 +11,13 @@ import org.robolectric.android.controller.ActivityController; import org.robolectric.annotation.Config; +import androidx.fragment.app.FragmentActivity; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleOwner; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE, sdk = 17) public class AndroidLifecycleActivityTest { diff --git a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleFragmentTest.java b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleFragmentTest.java index 9726843..a507a0a 100644 --- a/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleFragmentTest.java +++ b/rxlifecycle-android-lifecycle/src/test/java/com/trello/rxlifecycle2/android/lifecycle/AndroidLifecycleFragmentTest.java @@ -1,14 +1,8 @@ package com.trello.rxlifecycle2.android.lifecycle; -import android.arch.lifecycle.Lifecycle; -import android.arch.lifecycle.LifecycleOwner; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; import com.trello.lifecycle2.android.lifecycle.AndroidLifecycle; import com.trello.rxlifecycle2.LifecycleProvider; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -17,6 +11,14 @@ import org.robolectric.android.controller.ActivityController; import org.robolectric.annotation.Config; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleOwner; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE) public class AndroidLifecycleFragmentTest { diff --git a/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/RxLifecycleAndroid.java b/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/RxLifecycleAndroid.java index 8e9e7cc..71a0ed9 100644 --- a/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/RxLifecycleAndroid.java +++ b/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/RxLifecycleAndroid.java @@ -14,11 +14,13 @@ package com.trello.rxlifecycle2.android; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; import android.view.View; + import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.OutsideLifecycleException; + +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; import io.reactivex.Observable; import io.reactivex.functions.Function; diff --git a/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/ViewDetachesOnSubscribe.java b/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/ViewDetachesOnSubscribe.java index 5d72b8a..6275dcb 100644 --- a/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/ViewDetachesOnSubscribe.java +++ b/rxlifecycle-android/src/main/java/com/trello/rxlifecycle2/android/ViewDetachesOnSubscribe.java @@ -15,6 +15,7 @@ package com.trello.rxlifecycle2.android; import android.view.View; + import io.reactivex.ObservableEmitter; import io.reactivex.ObservableOnSubscribe; import io.reactivex.android.MainThreadDisposable; diff --git a/rxlifecycle-android/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java b/rxlifecycle-android/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java index 8c2101b..2484273 100644 --- a/rxlifecycle-android/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java +++ b/rxlifecycle-android/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java @@ -16,13 +16,11 @@ import android.app.Activity; import android.view.View; + import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.BehaviorSubject; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -32,6 +30,11 @@ import java.util.concurrent.CopyOnWriteArrayList; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.BehaviorSubject; +import io.reactivex.subjects.PublishSubject; + import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; diff --git a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxEditTextPreferenceDialogFragmentCompat.java b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxEditTextPreferenceDialogFragmentCompat.java index 2701b97..d9af71c 100644 --- a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxEditTextPreferenceDialogFragmentCompat.java +++ b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxEditTextPreferenceDialogFragmentCompat.java @@ -15,17 +15,19 @@ package com.trello.rxlifecycle2.components.preference; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.preference.EditTextPreferenceDialogFragmentCompat; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.preference.EditTextPreferenceDialogFragmentCompat; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxListPreferenceDialogFragmentCompat.java b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxListPreferenceDialogFragmentCompat.java index 4f7a163..8f6055b 100644 --- a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxListPreferenceDialogFragmentCompat.java +++ b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxListPreferenceDialogFragmentCompat.java @@ -15,17 +15,19 @@ package com.trello.rxlifecycle2.components.preference; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.preference.ListPreferenceDialogFragmentCompat; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.preference.ListPreferenceDialogFragmentCompat; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceDialogFragmentCompat.java b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceDialogFragmentCompat.java index 5212f2a..1c3c277 100644 --- a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceDialogFragmentCompat.java +++ b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceDialogFragmentCompat.java @@ -15,17 +15,19 @@ package com.trello.rxlifecycle2.components.preference; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.preference.PreferenceDialogFragmentCompat; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.preference.PreferenceDialogFragmentCompat; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentCompat.java b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentCompat.java index 0f98532..28dc348 100644 --- a/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentCompat.java +++ b/rxlifecycle-components-preference/src/main/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentCompat.java @@ -15,11 +15,6 @@ package com.trello.rxlifecycle2.components.preference; import android.os.Bundle; -import android.support.v7.preference.PreferenceFragmentCompat; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.View; import com.trello.rxlifecycle2.LifecycleProvider; @@ -28,6 +23,11 @@ import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.preference.PreferenceFragmentCompat; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components-preference/src/test/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentLifecycleTest.java b/rxlifecycle-components-preference/src/test/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentLifecycleTest.java index cb9ad03..b722462 100644 --- a/rxlifecycle-components-preference/src/test/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentLifecycleTest.java +++ b/rxlifecycle-components-preference/src/test/java/com/trello/rxlifecycle2/components/preference/RxPreferenceFragmentLifecycleTest.java @@ -15,13 +15,10 @@ package com.trello.rxlifecycle2.components.preference; import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.FragmentEvent; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -29,6 +26,12 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.rxlifecycle2.android.FragmentEvent.STOP; @RunWith(RobolectricTestRunner.class) diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxActivity.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxActivity.java index 2b9e6e2..4ddcb6f 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxActivity.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxActivity.java @@ -16,15 +16,17 @@ import android.app.Activity; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxDialogFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxDialogFragment.java index 8f37487..809faf1 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxDialogFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxDialogFragment.java @@ -16,16 +16,18 @@ import android.app.DialogFragment; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxFragment.java index d149912..9921ee0 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxFragment.java @@ -16,16 +16,18 @@ import android.app.Fragment; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxPreferenceFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxPreferenceFragment.java index 4177aa3..f4664cb 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxPreferenceFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/RxPreferenceFragment.java @@ -16,16 +16,18 @@ import android.os.Bundle; import android.preference.PreferenceFragment; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatActivity.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatActivity.java index 9096d63..a3c9aba 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatActivity.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatActivity.java @@ -15,16 +15,18 @@ package com.trello.rxlifecycle2.components.support; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatDialogFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatDialogFragment.java index 7fe6276..27bfb41 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatDialogFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxAppCompatDialogFragment.java @@ -15,17 +15,19 @@ package com.trello.rxlifecycle2.components.support; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatDialogFragment; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatDialogFragment; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxDialogFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxDialogFragment.java index 80d629f..f5955f9 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxDialogFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxDialogFragment.java @@ -15,17 +15,19 @@ package com.trello.rxlifecycle2.components.support; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.DialogFragment; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.DialogFragment; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragment.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragment.java index 466309b..d5a07e2 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragment.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragment.java @@ -15,16 +15,18 @@ package com.trello.rxlifecycle2.components.support; import android.os.Bundle; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.Fragment; import android.view.View; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragmentActivity.java b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragmentActivity.java index b229152..bf90aa1 100644 --- a/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragmentActivity.java +++ b/rxlifecycle-components/src/main/java/com/trello/rxlifecycle2/components/support/RxFragmentActivity.java @@ -15,16 +15,18 @@ package com.trello.rxlifecycle2.components.support; import android.os.Bundle; -import android.support.annotation.CallSuper; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentActivity; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.LifecycleTransformer; import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CallSuper; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.FragmentActivity; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxActivityLifecycleTest.java b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxActivityLifecycleTest.java index 6b5dd5b..fbe660f 100644 --- a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxActivityLifecycleTest.java +++ b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxActivityLifecycleTest.java @@ -17,9 +17,7 @@ import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.components.support.RxFragmentActivity; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +26,10 @@ import org.robolectric.android.controller.ActivityController; import org.robolectric.annotation.Config; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.rxlifecycle2.android.ActivityEvent.STOP; @RunWith(RobolectricTestRunner.class) diff --git a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxFragmentLifecycleTest.java b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxFragmentLifecycleTest.java index f795f60..51cc9f0 100644 --- a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxFragmentLifecycleTest.java +++ b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/RxFragmentLifecycleTest.java @@ -15,11 +15,10 @@ package com.trello.rxlifecycle2.components; import android.app.Fragment; + import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.FragmentEvent; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,6 +26,10 @@ import org.robolectric.annotation.Config; import org.robolectric.util.FragmentTestUtil; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.rxlifecycle2.android.FragmentEvent.STOP; import static org.robolectric.util.FragmentTestUtil.startFragment; diff --git a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/support/RxSupportFragmentLifecycleTest.java b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/support/RxSupportFragmentLifecycleTest.java index ce45aa1..564ecf9 100644 --- a/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/support/RxSupportFragmentLifecycleTest.java +++ b/rxlifecycle-components/src/test/java/com/trello/rxlifecycle2/components/support/RxSupportFragmentLifecycleTest.java @@ -14,13 +14,9 @@ package com.trello.rxlifecycle2.components.support; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.FragmentEvent; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -28,6 +24,12 @@ import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.rxlifecycle2.android.FragmentEvent.STOP; @RunWith(RobolectricTestRunner.class) diff --git a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/ActivityLifecycleProviderImpl.java b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/ActivityLifecycleProviderImpl.java index 41fbbde..59f280b 100644 --- a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/ActivityLifecycleProviderImpl.java +++ b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/ActivityLifecycleProviderImpl.java @@ -14,8 +14,6 @@ package com.trello.rxlifecycle2.navi; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; import com.trello.navi2.Event; import com.trello.navi2.NaviComponent; import com.trello.navi2.rx.RxNavi; @@ -24,6 +22,9 @@ import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/FragmentLifecycleProviderImpl.java b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/FragmentLifecycleProviderImpl.java index 3e720f4..b2e1f35 100644 --- a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/FragmentLifecycleProviderImpl.java +++ b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/FragmentLifecycleProviderImpl.java @@ -14,8 +14,6 @@ package com.trello.rxlifecycle2.navi; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; import com.trello.navi2.Event; import com.trello.navi2.NaviComponent; import com.trello.navi2.rx.RxNavi; @@ -24,6 +22,9 @@ import com.trello.rxlifecycle2.RxLifecycle; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.android.RxLifecycleAndroid; + +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; import io.reactivex.Observable; import io.reactivex.subjects.BehaviorSubject; diff --git a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java index d0f8edd..3cc19b8 100644 --- a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java +++ b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycle.java @@ -14,13 +14,14 @@ package com.trello.rxlifecycle2.navi; -import android.support.annotation.CheckResult; -import android.support.annotation.NonNull; import com.trello.navi2.NaviComponent; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.FragmentEvent; +import androidx.annotation.CheckResult; +import androidx.annotation.NonNull; + import static com.trello.rxlifecycle2.internal.Preconditions.checkNotNull; public final class NaviLifecycle { diff --git a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycleMaps.java b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycleMaps.java index d058aa8..07c87f5 100644 --- a/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycleMaps.java +++ b/rxlifecycle-navi/src/main/java/com/trello/rxlifecycle2/navi/NaviLifecycleMaps.java @@ -14,10 +14,11 @@ package com.trello.rxlifecycle2.navi; -import android.support.annotation.NonNull; import com.trello.navi2.Event; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.android.FragmentEvent; + +import androidx.annotation.NonNull; import io.reactivex.functions.Function; import io.reactivex.functions.Predicate; diff --git a/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviActivityLifecycleTest.java b/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviActivityLifecycleTest.java index 885bd72..e27a108 100644 --- a/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviActivityLifecycleTest.java +++ b/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviActivityLifecycleTest.java @@ -15,20 +15,23 @@ package com.trello.rxlifecycle2.components; import android.os.Bundle; + import com.trello.navi2.Event; import com.trello.navi2.NaviComponent; import com.trello.navi2.internal.NaviEmitter; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.navi.NaviLifecycle; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Test; import java.lang.ref.WeakReference; import java.util.HashSet; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.navi2.internal.NaviEmitter.createActivityEmitter; import static com.trello.rxlifecycle2.android.ActivityEvent.STOP; import static com.trello.rxlifecycle2.navi.NaviLifecycle.createActivityLifecycleProvider; diff --git a/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviFragmentLifecycleTest.java b/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviFragmentLifecycleTest.java index d2987a6..c8bd3c6 100644 --- a/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviFragmentLifecycleTest.java +++ b/rxlifecycle-navi/src/test/java/com/trello/rxlifecycle2/components/NaviFragmentLifecycleTest.java @@ -15,20 +15,23 @@ package com.trello.rxlifecycle2.components; import android.os.Bundle; + import com.trello.navi2.Event; import com.trello.navi2.NaviComponent; import com.trello.navi2.internal.NaviEmitter; import com.trello.rxlifecycle2.LifecycleProvider; import com.trello.rxlifecycle2.android.FragmentEvent; import com.trello.rxlifecycle2.navi.NaviLifecycle; -import io.reactivex.Observable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; + import org.junit.Test; import java.lang.ref.WeakReference; import java.util.HashSet; +import io.reactivex.Observable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + import static com.trello.navi2.internal.NaviEmitter.createFragmentEmitter; import static com.trello.rxlifecycle2.android.FragmentEvent.STOP; import static com.trello.rxlifecycle2.navi.NaviLifecycle.createFragmentLifecycleProvider; diff --git a/rxlifecycle-sample/src/main/java/com/trello/rxlifecycle2/sample/MainActivity.java b/rxlifecycle-sample/src/main/java/com/trello/rxlifecycle2/sample/MainActivity.java index 39e0f12..0b68dc3 100644 --- a/rxlifecycle-sample/src/main/java/com/trello/rxlifecycle2/sample/MainActivity.java +++ b/rxlifecycle-sample/src/main/java/com/trello/rxlifecycle2/sample/MainActivity.java @@ -16,14 +16,16 @@ import android.os.Bundle; import android.util.Log; + import com.trello.rxlifecycle2.android.ActivityEvent; import com.trello.rxlifecycle2.components.support.RxAppCompatActivity; + +import java.util.concurrent.TimeUnit; + import io.reactivex.Observable; import io.reactivex.functions.Action; import io.reactivex.functions.Consumer; -import java.util.concurrent.TimeUnit; - public class MainActivity extends RxAppCompatActivity { private static final String TAG = "RxLifecycleAndroid"; diff --git a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/Functions.java b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/Functions.java index 824c27d..e911942 100644 --- a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/Functions.java +++ b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/Functions.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import java.util.concurrent.CancellationException; + import io.reactivex.Completable; import io.reactivex.exceptions.Exceptions; import io.reactivex.functions.Function; import io.reactivex.functions.Predicate; -import java.util.concurrent.CancellationException; final class Functions { diff --git a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleProvider.java b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleProvider.java index dba6391..7215567 100644 --- a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleProvider.java +++ b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleProvider.java @@ -14,11 +14,11 @@ package com.trello.rxlifecycle2; -import io.reactivex.Observable; - import javax.annotation.CheckReturnValue; import javax.annotation.Nonnull; +import io.reactivex.Observable; + /** * Common base interface for activity and fragment lifecycle providers. * diff --git a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleTransformer.java b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleTransformer.java index ed5c008..1eddbe8 100644 --- a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleTransformer.java +++ b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/LifecycleTransformer.java @@ -14,6 +14,10 @@ package com.trello.rxlifecycle2; +import org.reactivestreams.Publisher; + +import javax.annotation.ParametersAreNonnullByDefault; + import io.reactivex.BackpressureStrategy; import io.reactivex.Completable; import io.reactivex.CompletableSource; @@ -29,9 +33,6 @@ import io.reactivex.Single; import io.reactivex.SingleSource; import io.reactivex.SingleTransformer; -import org.reactivestreams.Publisher; - -import javax.annotation.ParametersAreNonnullByDefault; import static com.trello.rxlifecycle2.internal.Preconditions.checkNotNull; diff --git a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/RxLifecycle.java b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/RxLifecycle.java index 743fa3e..9717aed 100644 --- a/rxlifecycle/src/main/java/com/trello/rxlifecycle2/RxLifecycle.java +++ b/rxlifecycle/src/main/java/com/trello/rxlifecycle2/RxLifecycle.java @@ -14,14 +14,14 @@ package com.trello.rxlifecycle2; +import javax.annotation.CheckReturnValue; +import javax.annotation.Nonnull; + import io.reactivex.Observable; import io.reactivex.functions.BiFunction; import io.reactivex.functions.Function; import io.reactivex.functions.Predicate; -import javax.annotation.CheckReturnValue; -import javax.annotation.Nonnull; - import static com.trello.rxlifecycle2.internal.Preconditions.checkNotNull; public class RxLifecycle { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/OutsideLifecycleExceptionTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/OutsideLifecycleExceptionTest.java index f00a4d9..b3f7107 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/OutsideLifecycleExceptionTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/OutsideLifecycleExceptionTest.java @@ -14,12 +14,13 @@ package com.trello.rxlifecycle2; +import org.junit.Test; + import io.reactivex.exceptions.CompositeException; import io.reactivex.functions.Function; import io.reactivex.functions.Predicate; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.PublishSubject; -import org.junit.Test; public class OutsideLifecycleExceptionTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java index 45cc5c6..ffc3b9a 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/RxLifecycleTest.java @@ -14,12 +14,13 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.Observable; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.BehaviorSubject; import io.reactivex.subjects.PublishSubject; -import org.junit.Before; -import org.junit.Test; public class RxLifecycleTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerCompletableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerCompletableTest.java index d13793f..607ea07 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerCompletableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerCompletableTest.java @@ -14,15 +14,16 @@ package com.trello.rxlifecycle2; -import io.reactivex.Completable; -import io.reactivex.functions.Function; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; +import io.reactivex.Completable; +import io.reactivex.functions.Function; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + public class UntilCorrespondingEventTransformerCompletableTest { PublishSubject subject; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerFlowableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerFlowableTest.java index 6881e35..d512009 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerFlowableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerFlowableTest.java @@ -14,12 +14,13 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.functions.Function; import io.reactivex.processors.PublishProcessor; import io.reactivex.subjects.PublishSubject; import io.reactivex.subscribers.TestSubscriber; -import org.junit.Before; -import org.junit.Test; public class UntilCorrespondingEventTransformerFlowableTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerMaybeTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerMaybeTest.java index 75e32dd..95af6da 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerMaybeTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerMaybeTest.java @@ -14,12 +14,13 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.Maybe; import io.reactivex.functions.Function; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.PublishSubject; -import org.junit.Before; -import org.junit.Test; public class UntilCorrespondingEventTransformerMaybeTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerObservableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerObservableTest.java index 90d1aef..c4da532 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerObservableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerObservableTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.functions.Function; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.PublishSubject; -import org.junit.Before; -import org.junit.Test; public class UntilCorrespondingEventTransformerObservableTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerSingleTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerSingleTest.java index e0ce374..ab85aef 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerSingleTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilCorrespondingEventTransformerSingleTest.java @@ -14,17 +14,18 @@ package com.trello.rxlifecycle2; -import io.reactivex.Single; -import io.reactivex.functions.Function; -import io.reactivex.observers.TestObserver; -import io.reactivex.schedulers.TestScheduler; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; import java.util.concurrent.TimeUnit; +import io.reactivex.Single; +import io.reactivex.functions.Function; +import io.reactivex.observers.TestObserver; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.PublishSubject; + public class UntilCorrespondingEventTransformerSingleTest { PublishSubject lifecycle; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerCompletableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerCompletableTest.java index e3aaeaa..795964f 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerCompletableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerCompletableTest.java @@ -14,14 +14,15 @@ package com.trello.rxlifecycle2; -import io.reactivex.Completable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; +import io.reactivex.Completable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + public class UntilEventTransformerCompletableTest { PublishSubject subject; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerFlowableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerFlowableTest.java index 399f688..de6a830 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerFlowableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerFlowableTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.processors.PublishProcessor; import io.reactivex.subjects.PublishSubject; import io.reactivex.subscribers.TestSubscriber; -import org.junit.Before; -import org.junit.Test; public class UntilEventTransformerFlowableTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerMaybeTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerMaybeTest.java index 8492216..a4dd296 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerMaybeTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerMaybeTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.Maybe; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.PublishSubject; -import org.junit.Before; -import org.junit.Test; public class UntilEventTransformerMaybeTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerObservableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerObservableTest.java index 0ea6549..f52a298 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerObservableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerObservableTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + public class UntilEventTransformerObservableTest { PublishSubject stream; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerSingleTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerSingleTest.java index f4853ae..ad71ca2 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerSingleTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilEventTransformerSingleTest.java @@ -14,16 +14,17 @@ package com.trello.rxlifecycle2; -import io.reactivex.Single; -import io.reactivex.observers.TestObserver; -import io.reactivex.schedulers.TestScheduler; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; import java.util.concurrent.TimeUnit; +import io.reactivex.Single; +import io.reactivex.observers.TestObserver; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.PublishSubject; + public class UntilEventTransformerSingleTest { PublishSubject lifecycle; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerCompletableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerCompletableTest.java index 4ad88a5..702c839 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerCompletableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerCompletableTest.java @@ -14,14 +14,15 @@ package com.trello.rxlifecycle2; -import io.reactivex.Completable; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; +import io.reactivex.Completable; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + public class UntilLifecycleTransformerCompletableTest { PublishSubject subject; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerFlowableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerFlowableTest.java index 04369f5..03dee9a 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerFlowableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerFlowableTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.processors.PublishProcessor; import io.reactivex.subjects.PublishSubject; import io.reactivex.subscribers.TestSubscriber; -import org.junit.Before; -import org.junit.Test; public class UntilLifecycleTransformerFlowableTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerMaybeTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerMaybeTest.java index 6a920f5..be8cc2b 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerMaybeTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerMaybeTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; +import org.junit.Before; +import org.junit.Test; + import io.reactivex.Maybe; import io.reactivex.observers.TestObserver; import io.reactivex.subjects.PublishSubject; -import org.junit.Before; -import org.junit.Test; public class UntilLifecycleTransformerMaybeTest { diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerObservableTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerObservableTest.java index caa94d9..b2fbc10 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerObservableTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerObservableTest.java @@ -14,11 +14,12 @@ package com.trello.rxlifecycle2; -import io.reactivex.observers.TestObserver; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; +import io.reactivex.observers.TestObserver; +import io.reactivex.subjects.PublishSubject; + public class UntilLifecycleTransformerObservableTest { PublishSubject stream; diff --git a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerSingleTest.java b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerSingleTest.java index 2eae583..7e2a2a3 100644 --- a/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerSingleTest.java +++ b/rxlifecycle/src/test/java/com/trello/rxlifecycle2/UntilLifecycleTransformerSingleTest.java @@ -14,16 +14,17 @@ package com.trello.rxlifecycle2; -import io.reactivex.Single; -import io.reactivex.observers.TestObserver; -import io.reactivex.schedulers.TestScheduler; -import io.reactivex.subjects.PublishSubject; import org.junit.Before; import org.junit.Test; import java.util.concurrent.CancellationException; import java.util.concurrent.TimeUnit; +import io.reactivex.Single; +import io.reactivex.observers.TestObserver; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.PublishSubject; + public class UntilLifecycleTransformerSingleTest { PublishSubject lifecycle;