diff --git a/build.gradle b/build.gradle index 4692653..2a86ecd 100644 --- a/build.gradle +++ b/build.gradle @@ -41,8 +41,8 @@ ext { buildToolsVersion = '25.0.2' supportVersion = '25.1.0' mosbyVersion = '2.0.1' - rxJavaVersion = '1.2.3' - rxAndroidVersion = '1.2.1' + rxJavaVersion = '2.0.3' + rxAndroidVersion = '2.0.1' rxBindingVersion = '1.0.0' butterKnifeVersion = '8.4.0' retrofitVersion = '2.0.2' diff --git a/moviper-test/build.gradle b/moviper-test/build.gradle index af896c6..ec7fdcf 100644 --- a/moviper-test/build.gradle +++ b/moviper-test/build.gradle @@ -34,8 +34,8 @@ dependencies { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:' + rootProject.ext.supportVersion - compile 'io.reactivex:rxjava:' + rootProject.ext.rxJavaVersion - compile 'io.reactivex:rxandroid:' + rootProject.ext.rxAndroidVersion + compile 'io.reactivex.rxjava2:rxjava:' + rootProject.ext.rxJavaVersion + compile 'io.reactivex.rxjava2:rxandroid:' + rootProject.ext.rxAndroidVersion compile 'junit:junit:' + rootProject.ext.junitVersion compile project(':moviper') diff --git a/moviper-test/src/main/java/com/mateuszkoslacz/moviper/tests/rules/RxAndroidSchedulersOverrideRule.java b/moviper-test/src/main/java/com/mateuszkoslacz/moviper/tests/rules/RxAndroidSchedulersOverrideRule.java index 26d2bed..724eec2 100644 --- a/moviper-test/src/main/java/com/mateuszkoslacz/moviper/tests/rules/RxAndroidSchedulersOverrideRule.java +++ b/moviper-test/src/main/java/com/mateuszkoslacz/moviper/tests/rules/RxAndroidSchedulersOverrideRule.java @@ -4,12 +4,8 @@ import org.junit.runner.Description; import org.junit.runners.model.Statement; -import rx.Scheduler; -import rx.android.plugins.RxAndroidPlugins; -import rx.android.plugins.RxAndroidSchedulersHook; -import rx.plugins.RxJavaPlugins; -import rx.plugins.RxJavaSchedulersHook; -import rx.schedulers.Schedulers; +import io.reactivex.android.plugins.RxAndroidPlugins; +import io.reactivex.schedulers.Schedulers; /** * This rule registers SchedulerHooks for RxJava and RxAndroid to ensure that subscriptions always @@ -19,46 +15,15 @@ */ public class RxAndroidSchedulersOverrideRule implements TestRule { - private final RxJavaSchedulersHook mRxJavaSchedulersHook = new RxJavaSchedulersHook() { - @Override - public Scheduler getIOScheduler() { - return Schedulers.immediate(); - } - - @Override - public Scheduler getNewThreadScheduler() { - return Schedulers.immediate(); - } - - @Override - public Scheduler getComputationScheduler() { - return Schedulers.immediate(); - } - }; - - private final RxAndroidSchedulersHook mRxAndroidSchedulersHook = new RxAndroidSchedulersHook() { - @Override - public Scheduler getMainThreadScheduler() { - return Schedulers.immediate(); - } - }; @Override public Statement apply(final Statement base, Description description) { return new Statement() { @Override public void evaluate() throws Throwable { - overrideHooks(); + RxAndroidPlugins.setInitMainThreadSchedulerHandler(__ -> Schedulers.trampoline()); base.evaluate(); } }; } - - private void overrideHooks() { - RxAndroidPlugins.getInstance().reset(); - RxAndroidPlugins.getInstance().registerSchedulersHook(mRxAndroidSchedulersHook); - - RxJavaPlugins.getInstance().reset(); - RxJavaPlugins.getInstance().registerSchedulersHook(mRxJavaSchedulersHook); - } } \ No newline at end of file diff --git a/moviper/build.gradle b/moviper/build.gradle index f7f6e05..031bcb7 100644 --- a/moviper/build.gradle +++ b/moviper/build.gradle @@ -47,7 +47,7 @@ dependencies { // TODO: probably should split to two flavours to avoid // including rxJava in projects that don't use rx - compile 'io.reactivex:rxjava:' + rootProject.ext.rxJavaVersion + compile 'io.reactivex.rxjava2:rxjava:' + rootProject.ext.rxJavaVersion compile 'com.jakewharton:butterknife:' + rootProject.ext.butterKnifeVersion apt 'com.jakewharton:butterknife-compiler:' + rootProject.ext.butterKnifeVersion diff --git a/moviper/src/main/java/com/mateuszkoslacz/moviper/base/presenter/BaseRxPresenter.java b/moviper/src/main/java/com/mateuszkoslacz/moviper/base/presenter/BaseRxPresenter.java index e10cab4..984a25b 100644 --- a/moviper/src/main/java/com/mateuszkoslacz/moviper/base/presenter/BaseRxPresenter.java +++ b/moviper/src/main/java/com/mateuszkoslacz/moviper/base/presenter/BaseRxPresenter.java @@ -13,8 +13,10 @@ import com.mateuszkoslacz.moviper.iface.view.ViperView; import com.mateuszkoslacz.moviper.presenterbus.Moviper; -import rx.Subscription; -import rx.subscriptions.CompositeSubscription; +import org.reactivestreams.Subscription; + +import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.disposables.Disposable; /** * Created by mateuszkoslacz on 08.08.2016. @@ -49,7 +51,7 @@ public abstract class BaseRxPresenter private InteractorType interactor; - private CompositeSubscription compositeSubscription; + private CompositeDisposable compositeSubscription; public BaseRxPresenter() { this(null); @@ -57,7 +59,7 @@ public BaseRxPresenter() { public BaseRxPresenter(Bundle args) { super(args); - this.compositeSubscription = new CompositeSubscription(); + this.compositeSubscription = new CompositeDisposable(); this.routing = createRouting(); this.interactor = createInteractor(); } @@ -91,7 +93,7 @@ public InteractorType getInteractor() { return interactor; } - protected void addSubscription(Subscription subscription) { + protected void addSubscription(Disposable subscription) { if (compositeSubscription != null) compositeSubscription.add(subscription); } diff --git a/moviper/src/main/java/com/mateuszkoslacz/moviper/presenterbus/Moviper.java b/moviper/src/main/java/com/mateuszkoslacz/moviper/presenterbus/Moviper.java index 5a5702b..983c2ac 100644 --- a/moviper/src/main/java/com/mateuszkoslacz/moviper/presenterbus/Moviper.java +++ b/moviper/src/main/java/com/mateuszkoslacz/moviper/presenterbus/Moviper.java @@ -11,9 +11,10 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import rx.Observable; -import rx.schedulers.Schedulers; -import rx.subjects.PublishSubject; +import io.reactivex.Maybe; +import io.reactivex.Observable; +import io.reactivex.schedulers.Schedulers; +import io.reactivex.subjects.PublishSubject; /** * Created by mateuszkoslacz on 24.10.2016. @@ -88,7 +89,7 @@ private void routeMoviperBundle(MoviperBundle bundle) { public Observable getPresenters( final Class presenterTypeClass) { if (!mConfig.isPresenterAccessUtilEnabled()) throw new PresentersAccessUtilNotEnabled(); - return Observable.from(mPresenters) + return Observable.fromIterable(mPresenters) .filter(presenterTypeClass::isInstance) .map(presenterTypeClass::cast) .subscribeOn(Schedulers.computation()); // TODO: reconsider moving to computation scheduler @@ -111,14 +112,14 @@ public Observable getPrese * returning proper name in {@link ViperPresenter#getName()}. * @return {@link Observable} that emits (or not) Presenter instance of given name and class. */ - public Observable getPresenterInstance( + public Maybe getPresenterInstance( final Class presenterTypeClass, String name) { if (!mConfig.isInstancePresentersEnabled()) throw new PresenterInstancesAccessNotEnabled(); - return Observable.from(mPresenters) + return Observable.fromIterable(mPresenters) .filter(moviperPresenter -> moviperPresenter.getName().equals(name)) .filter(presenterTypeClass::isInstance) .map(presenterTypeClass::cast) - .takeFirst(presenterType -> true) + .firstElement() .subscribeOn(Schedulers.computation()); } diff --git a/moviper/src/test/java/com/mateuszkoslacz/moviper/presenterbus/MoviperTest.java b/moviper/src/test/java/com/mateuszkoslacz/moviper/presenterbus/MoviperTest.java index e397235..f1cb334 100644 --- a/moviper/src/test/java/com/mateuszkoslacz/moviper/presenterbus/MoviperTest.java +++ b/moviper/src/test/java/com/mateuszkoslacz/moviper/presenterbus/MoviperTest.java @@ -12,7 +12,7 @@ import org.junit.rules.ExpectedException; import org.mockito.Mockito; -import rx.observers.TestSubscriber; +import io.reactivex.observers.TestSubscriber; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/sample-independent-viper/build.gradle b/sample-independent-viper/build.gradle index 2915eaf..b47efa1 100644 --- a/sample-independent-viper/build.gradle +++ b/sample-independent-viper/build.gradle @@ -24,6 +24,9 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + packagingOptions { + exclude 'META-INF/rxjava.properties' + } } dependencies { @@ -38,6 +41,9 @@ dependencies { compile 'com.squareup.retrofit2:retrofit:' + rootProject.ext.retrofitVersion compile 'com.squareup.retrofit2:converter-gson:' + rootProject.ext.retrofitVersion - compile 'com.squareup.retrofit2:adapter-rxjava:' + rootProject.ext.retrofitVersion + compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' compile 'com.squareup.okhttp3:logging-interceptor:' + rootProject.ext.okHttpVersion + compile 'io.reactivex.rxjava2:rxandroid:2.0.1' + compile "com.github.akarnokd:rxjava2-interop:0.9.1" + } diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/retrofit/GitHubApiInterface.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/retrofit/GitHubApiInterface.java index c613e12..1683995 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/retrofit/GitHubApiInterface.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/retrofit/GitHubApiInterface.java @@ -6,7 +6,7 @@ import retrofit2.http.GET; import retrofit2.http.Path; -import rx.Observable; +import io.reactivex.Observable; public interface GitHubApiInterface { diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/IndependentContract.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/IndependentContract.java index 68c2c08..7491f45 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/IndependentContract.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/IndependentContract.java @@ -8,7 +8,7 @@ import java.util.List; -import rx.Observable; +import io.reactivex.Observable; public interface IndependentContract { diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/MainContract.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/MainContract.java index 012c85f..d36253a 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/MainContract.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/contract/MainContract.java @@ -4,7 +4,7 @@ import com.mateuszkoslacz.moviper.iface.interactor.ViperRxInteractor; import com.mateuszkoslacz.moviper.iface.routing.ViperRxRouting; -import rx.Observable; +import io.reactivex.Observable; public interface MainContract { @@ -14,9 +14,9 @@ interface View extends MvpView { void enableStop(); - Observable onStartClicks(); + Observable onStartClicks(); - Observable onStopClicks(); + Observable onStopClicks(); } interface Interactor extends ViperRxInteractor { diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/interactor/IndependentInteractor.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/interactor/IndependentInteractor.java index d1e71f2..d9b6faf 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/interactor/IndependentInteractor.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/interactor/IndependentInteractor.java @@ -1,5 +1,6 @@ package com.mateuszkoslacz.sample.viper.interactor; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.base.interactor.BaseRxInteractor; import com.mateuszkoslacz.sample.retrofit.GitHubApiInterface; import com.mateuszkoslacz.sample.viper.contract.IndependentContract; @@ -8,9 +9,8 @@ import java.util.List; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; +import io.reactivex.Observable; public class IndependentInteractor extends BaseRxInteractor @@ -22,7 +22,7 @@ public IndependentInteractor() { Retrofit retrofit = new Retrofit.Builder() .baseUrl(GitHubApiInterface.GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); gitHubApiInterface = retrofit.create(GitHubApiInterface.class); } diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/presenter/IndependentPresenter.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/presenter/IndependentPresenter.java index 747835c..fe814ba 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/presenter/IndependentPresenter.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/presenter/IndependentPresenter.java @@ -11,10 +11,10 @@ import java.util.concurrent.TimeUnit; -import rx.Observable; -import rx.Subscription; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.Observable; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.disposables.Disposable; +import io.reactivex.schedulers.Schedulers; public class IndependentPresenter extends BaseRxPresenter @@ -25,7 +25,7 @@ public class IndependentPresenter public static final String UNIQUE_NAME = "INDEPENDENT_PRESENTER"; - private Subscription subscription; + private Disposable subscription; @Override public String getName() { @@ -50,7 +50,7 @@ public void attachView(ViperView view) { subscription = getInteractor().getUserList() .flatMap(users -> Observable.zip( - Observable.from(users), + Observable.fromIterable(users), Observable.interval(2, TimeUnit.SECONDS), (user, aLong) -> user )) @@ -64,7 +64,7 @@ public void attachView(ViperView view) { @Override public void detachView(boolean retainInstance) { - if (subscription != null && !subscription.isUnsubscribed()) subscription.unsubscribe(); + if (subscription != null && !subscription.isDisposed()) subscription.dispose(); super.detachView(retainInstance); } } diff --git a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/view/activity/MainActivity.java b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/view/activity/MainActivity.java index b35b406..019cd23 100644 --- a/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/view/activity/MainActivity.java +++ b/sample-independent-viper/src/main/java/com/mateuszkoslacz/sample/viper/view/activity/MainActivity.java @@ -11,7 +11,8 @@ import com.mateuszkoslacz.sample.viper.presenter.MainPresenter; import butterknife.BindView; -import rx.Observable; +import hu.akarnokd.rxjava.interop.RxJavaInterop; +import io.reactivex.Observable; public class MainActivity extends ViperButterKnifePassiveActivity @@ -46,12 +47,12 @@ public void enableStop() { } @Override - public Observable onStartClicks() { - return RxView.clicks(btnStart); + public Observable onStartClicks() { + return RxJavaInterop.toV2Observable(RxView.clicks(btnStart).map(aVoid -> new Object())); } @Override - public Observable onStopClicks() { - return RxView.clicks(btnStop); + public Observable onStopClicks() { + return RxJavaInterop.toV2Observable(RxView.clicks(btnStop).map(aVoid -> new Object())); } } diff --git a/sample-ipc/build.gradle b/sample-ipc/build.gradle index be354ba..6000d06 100644 --- a/sample-ipc/build.gradle +++ b/sample-ipc/build.gradle @@ -38,8 +38,8 @@ dependencies { compile 'com.jakewharton:butterknife:' + rootProject.ext.butterKnifeVersion apt 'com.jakewharton:butterknife-compiler:' + rootProject.ext.butterKnifeVersion - compile 'io.reactivex:rxjava:' + rootProject.ext.rxJavaVersion - compile 'io.reactivex:rxandroid:' + rootProject.ext.rxAndroidVersion + compile 'io.reactivex.rxjava2:rxjava:' + rootProject.ext.rxJavaVersion + compile 'io.reactivex.rxjava2:rxandroid:' + rootProject.ext.rxAndroidVersion compile project(path: ':moviper') diff --git a/sample-ipc/src/main/java/com/mateuszkoslacz/moviper/ipcsample/viper/presenter/ColorWidgetPresenter.java b/sample-ipc/src/main/java/com/mateuszkoslacz/moviper/ipcsample/viper/presenter/ColorWidgetPresenter.java index 6866ff6..4cc49f3 100644 --- a/sample-ipc/src/main/java/com/mateuszkoslacz/moviper/ipcsample/viper/presenter/ColorWidgetPresenter.java +++ b/sample-ipc/src/main/java/com/mateuszkoslacz/moviper/ipcsample/viper/presenter/ColorWidgetPresenter.java @@ -10,7 +10,7 @@ import com.mateuszkoslacz.moviper.ipcsample.viper.routing.ColorWidgetRouting; import com.mateuszkoslacz.moviper.presenterbus.Moviper; -import rx.android.schedulers.AndroidSchedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; public class ColorWidgetPresenter extends BaseRxPresenter { private TestScheduler testScheduler; - private TestSubject> testUsersSubject; + private PublishSubject> testUsersSubject; public UserTestRepository() { this.testScheduler = new TestScheduler(); - this.testUsersSubject = TestSubject.create(testScheduler); + this.testUsersSubject = PublishSubject.create(); + this.testUsersSubject.subscribeOn(this.testScheduler); } @Override diff --git a/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/list/test/impl/AllUsersTestSpecification.java b/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/list/test/impl/AllUsersTestSpecification.java index fd3f4fe..f004e20 100644 --- a/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/list/test/impl/AllUsersTestSpecification.java +++ b/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/list/test/impl/AllUsersTestSpecification.java @@ -5,7 +5,7 @@ import java.util.List; -import rx.Observable; +import io.reactivex.Observable; public class AllUsersTestSpecification implements AllUsersSpecification { diff --git a/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/stream/test/impl/UserByUsernameStreamTestSpecification.java b/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/stream/test/impl/UserByUsernameStreamTestSpecification.java index e4ed2cd..a40b52d 100644 --- a/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/stream/test/impl/UserByUsernameStreamTestSpecification.java +++ b/sample-rx-rdp/src/androidTest/java/com/mateuszkoslacz/moviper/rxsample/utils/data/rdp/specification/stream/test/impl/UserByUsernameStreamTestSpecification.java @@ -3,7 +3,7 @@ import com.mateuszkoslacz.moviper.rxsample.data.rdp.specification.stream.UserByUsernameStreamSpecification; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; -import rx.Observable; +import io.reactivex.Observable; /** * Created by bwilk on 11/29/16. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/Repository.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/Repository.java index d061a22..bb41da1 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/Repository.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/Repository.java @@ -5,7 +5,7 @@ import java.util.List; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/retrofit/UserRetrofitRepository.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/retrofit/UserRetrofitRepository.java index 9720179..5366ca9 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/retrofit/UserRetrofitRepository.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/repository/retrofit/UserRetrofitRepository.java @@ -1,5 +1,6 @@ package com.mateuszkoslacz.moviper.rxsample.data.rdp.repository.retrofit; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.rxsample.data.rdp.repository.Repository; import com.mateuszkoslacz.moviper.rxsample.data.rdp.specification.list.base.Specification; import com.mateuszkoslacz.moviper.rxsample.data.rdp.specification.list.retrofit.RetrofitSpecification; @@ -9,10 +10,9 @@ import java.util.List; +import io.reactivex.Observable; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; /** * Created by jjodelka on 23/11/2016. @@ -28,7 +28,7 @@ public UserRetrofitRepository() { retrofit = new Retrofit.Builder() .baseUrl(GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); } diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/RetrofitSpecification.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/RetrofitSpecification.java index 1672b91..34162d3 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/RetrofitSpecification.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/RetrofitSpecification.java @@ -5,7 +5,7 @@ import java.util.List; import retrofit2.Retrofit; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/impl/AllUsersRetrofitSpecification.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/impl/AllUsersRetrofitSpecification.java index d2d3ee3..84cc9b3 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/impl/AllUsersRetrofitSpecification.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/list/retrofit/impl/AllUsersRetrofitSpecification.java @@ -8,7 +8,7 @@ import retrofit2.Retrofit; import retrofit2.http.GET; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/RetrofitStreamSpecification.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/RetrofitStreamSpecification.java index 816ad15..2a8195b 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/RetrofitStreamSpecification.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/RetrofitStreamSpecification.java @@ -3,7 +3,7 @@ import com.mateuszkoslacz.moviper.rxsample.data.rdp.specification.stream.base.StreamSpecification; import retrofit2.Retrofit; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/AllUsersRetrofitStreamSpecification.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/AllUsersRetrofitStreamSpecification.java index 2a3d444..c4bb499 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/AllUsersRetrofitStreamSpecification.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/AllUsersRetrofitStreamSpecification.java @@ -6,7 +6,7 @@ import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import retrofit2.Retrofit; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. @@ -16,6 +16,6 @@ public class AllUsersRetrofitStreamSpecification implements RetrofitStreamSpecif @Override public Observable getResults(Retrofit retrofit) { - return new AllUsersRetrofitSpecification().getResults(retrofit).flatMap(Observable::from); + return new AllUsersRetrofitSpecification().getResults(retrofit).flatMap(Observable::fromIterable); } } diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/UserByUsernameRetrofitStreamSpecification.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/UserByUsernameRetrofitStreamSpecification.java index 03645ae..2aa1f4e 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/UserByUsernameRetrofitStreamSpecification.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/rdp/specification/stream/retrofit/impl/UserByUsernameRetrofitStreamSpecification.java @@ -7,7 +7,7 @@ import retrofit2.Retrofit; import retrofit2.http.GET; import retrofit2.http.Path; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 23/11/2016. diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java index 44ffba5..041b04d 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java @@ -10,7 +10,7 @@ import java.util.List; -import rx.Observable; +import io.reactivex.Observable; public interface ListingContract { diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java index d405d27..768c7f5 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java @@ -9,7 +9,7 @@ import com.mateuszkoslacz.moviper.iface.viewhelper.ViperViewHelper; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; -import rx.Observable; +import io.reactivex.Observable; public interface UserDetailsContract { diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java index 422f7ae..cf59f33 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java @@ -8,7 +8,7 @@ import java.util.List; -import rx.Observable; +import io.reactivex.Observable; public class ListingInteractor extends BaseRxInteractor diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java index 8c2e54e..bfc0004 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java @@ -6,7 +6,7 @@ import com.mateuszkoslacz.moviper.rxsample.viper.contract.UserDetailsContract; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; -import rx.Observable; +import io.reactivex.Observable; public class UserDetailsInteractor extends BaseRxInteractor diff --git a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java index f075985..256614f 100644 --- a/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java +++ b/sample-rx-rdp/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java @@ -8,8 +8,9 @@ import com.mateuszkoslacz.moviper.rxsample.viper.interactor.ListingInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.routing.ListingRouting; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.plugins.RxJavaPlugins; +import io.reactivex.schedulers.Schedulers; public class ListingPresenter extends BaseRxPresenter getUsers() { .subscribe( timer -> subscriber.onNext(users.get(timer.intValue())), throwable -> subscriber.onError(throwable), - () -> subscriber.onCompleted()); + () -> subscriber.onComplete()); }); }); } diff --git a/sample-service/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/SampleServicePresenter.java b/sample-service/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/SampleServicePresenter.java index 81a6d7b..b0f7ad6 100644 --- a/sample-service/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/SampleServicePresenter.java +++ b/sample-service/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/SampleServicePresenter.java @@ -8,8 +8,8 @@ import com.mateuszkoslacz.moviper.rxsample.viper.interactor.SampleServiceInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.routing.SampleServiceRouting; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; public class SampleServicePresenter extends BaseRxPresenter(), diff --git a/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/UserDetailsPresenter.kt b/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/UserDetailsPresenter.kt index bcec49d..c9dac95 100644 --- a/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/UserDetailsPresenter.kt +++ b/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/UserDetailsPresenter.kt @@ -9,8 +9,8 @@ import com.mateuszkoslacz.moviper.rxsample.viper.interactor.UserDetailsInteracto import com.mateuszkoslacz.moviper.rxsample.viper.routing.UserDetailsRouting import com.mateuszkoslacz.moviper.rxsample.viper.view.activity.UserDetailsActivity -import rx.android.schedulers.AndroidSchedulers -import rx.schedulers.Schedulers +import io.reactivex.android.schedulers.AndroidSchedulers +import io.reactivex.schedulers.Schedulers class UserDetailsPresenter(bundle: Bundle) : BaseRxPresenter(), diff --git a/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/UserDetailsActivity.kt b/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/UserDetailsActivity.kt index 6718895..da8c665 100644 --- a/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/UserDetailsActivity.kt +++ b/sample-super-rx-ai-kotlin/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/UserDetailsActivity.kt @@ -12,8 +12,8 @@ import com.mateuszkoslacz.moviper.rxsample.viper.contract.UserDetailsContract import com.mateuszkoslacz.moviper.rxsample.viper.entity.User import com.mateuszkoslacz.moviper.presentersdispatcher.MoviperPresentersDispatcher import kotlinx.android.synthetic.main.activity_user_details.* -import rx.Observable -import rx.subjects.PublishSubject +import io.reactivex.Observable +import io.reactivex.subjects.PublishSubject class UserDetailsActivity : ViperLceAiPassiveActivity(), diff --git a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java index 98d46db..a5b0623 100644 --- a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java +++ b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java @@ -19,9 +19,9 @@ import java.util.ArrayList; import java.util.List; -import rx.schedulers.TestScheduler; -import rx.subjects.PublishSubject; -import rx.subjects.TestSubject; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.PublishSubject; +import io.reactivex.subjects.TestSubject; import static org.mockito.Mockito.any; import static org.mockito.Mockito.never; diff --git a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterWithoutViewTest.java b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterWithoutViewTest.java index babf62c..616031d 100644 --- a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterWithoutViewTest.java +++ b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterWithoutViewTest.java @@ -14,10 +14,10 @@ import java.util.ArrayList; import java.util.List; -import rx.Observable; -import rx.schedulers.TestScheduler; -import rx.subjects.PublishSubject; -import rx.subjects.TestSubject; +import io.reactivex.Observable; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.PublishSubject; +import io.reactivex.subjects.TestSubject; import static org.mockito.Mockito.any; import static org.mockito.Mockito.never; diff --git a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java index faa708a..bcb6a38 100644 --- a/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java +++ b/sample-super-rx-ai-kotlin/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java @@ -21,7 +21,7 @@ import java.util.Arrays; -import rx.observers.TestSubscriber; +import io.reactivex.observers.TestSubscriber; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/sample-super-rx-ai/build.gradle b/sample-super-rx-ai/build.gradle index 109f522..bdb9c66 100644 --- a/sample-super-rx-ai/build.gradle +++ b/sample-super-rx-ai/build.gradle @@ -41,11 +41,11 @@ dependencies { compile 'com.jakewharton:butterknife:' + rootProject.ext.butterKnifeVersion apt 'com.jakewharton:butterknife-compiler:' + rootProject.ext.butterKnifeVersion - compile 'io.reactivex:rxjava:' + rootProject.ext.rxJavaVersion - compile 'io.reactivex:rxandroid:' + rootProject.ext.rxAndroidVersion + compile 'io.reactivex.rxjava2:rxjava:' + rootProject.ext.rxJavaVersion + compile 'io.reactivex.rxjava2:rxandroid:' + rootProject.ext.rxAndroidVersion compile 'com.squareup.retrofit2:retrofit:' + rootProject.ext.retrofitVersion compile 'com.squareup.retrofit2:converter-gson:' + rootProject.ext.retrofitVersion - compile 'com.squareup.retrofit2:adapter-rxjava:' + rootProject.ext.retrofitVersion + compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' compile 'com.squareup.okhttp3:logging-interceptor:' + rootProject.ext.okHttpVersion compile project(path: ':moviper') diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java index d3bcddf..decef41 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java @@ -6,7 +6,7 @@ import retrofit2.http.GET; import retrofit2.http.Path; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 17/10/16. diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java index e549045..11f2e14 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java @@ -9,8 +9,8 @@ import java.util.List; -import rx.Observable; -import rx.subjects.Subject; +import io.reactivex.Observable; +import io.reactivex.subjects.Subject; public interface ListingContract { diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java index a5fdb44..1aba185 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java @@ -8,8 +8,8 @@ import com.mateuszkoslacz.moviper.iface.viewhelper.ViperViewHelper; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; -import rx.Observable; -import rx.subjects.Subject; +import io.reactivex.Observable; +import io.reactivex.subjects.Subject; public interface UserDetailsContract { diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java index 39fe109..a7c75b1 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java @@ -1,5 +1,6 @@ package com.mateuszkoslacz.moviper.rxsample.viper.interactor; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.base.interactor.BaseRxInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import com.mateuszkoslacz.moviper.rxsample.data.retrofit.GitHubApiInterface; @@ -8,9 +9,8 @@ import java.util.List; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; +import io.reactivex.Observable; public class ListingInteractor extends BaseRxInteractor @@ -22,7 +22,7 @@ public ListingInteractor() { Retrofit mRetrofit = new Retrofit.Builder() .baseUrl(GitHubApiInterface.GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); mGitHubApiInterface = mRetrofit.create(GitHubApiInterface.class); } diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java index 5f47652..e5839dd 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java @@ -1,14 +1,14 @@ package com.mateuszkoslacz.moviper.rxsample.viper.interactor; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.base.interactor.BaseRxInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import com.mateuszkoslacz.moviper.rxsample.data.retrofit.GitHubApiInterface; import com.mateuszkoslacz.moviper.rxsample.viper.contract.UserDetailsContract; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; +import io.reactivex.Observable; public class UserDetailsInteractor extends BaseRxInteractor @@ -20,7 +20,7 @@ public UserDetailsInteractor() { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(GitHubApiInterface.GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); mGitHubApiInterface = retrofit.create(GitHubApiInterface.class); } diff --git a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java index 0c357c0..3a3de8f 100644 --- a/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java +++ b/sample-super-rx-ai/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java @@ -8,8 +8,8 @@ import com.mateuszkoslacz.moviper.rxsample.viper.interactor.ListingInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.routing.ListingRouting; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; public class ListingPresenter extends BaseRxPresenter getAvatarClicks() { + public Subject getAvatarClicks() { return mAvatarClicks; } diff --git a/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java b/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java index b31b5ab..b377b6b 100644 --- a/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java +++ b/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenterTest.java @@ -18,8 +18,8 @@ import java.util.ArrayList; import java.util.List; -import rx.schedulers.TestScheduler; -import rx.subjects.TestSubject; +import io.reactivex.schedulers.TestScheduler; +import io.reactivex.subjects.TestSubject; import static org.mockito.Mockito.any; import static org.mockito.Mockito.never; diff --git a/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java b/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java index b9f7df3..3c2f21b 100644 --- a/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java +++ b/sample-super-rx-ai/src/test/java/com/mateuszkoslacz/moviper/rxsample/viper/view/activity/ListingActivityTest.java @@ -21,7 +21,7 @@ import java.util.Arrays; -import rx.observers.TestSubscriber; +import io.reactivex.observers.TestSubscriber; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/sample-super-rx-databinding/build.gradle b/sample-super-rx-databinding/build.gradle index 467c964..29829d1 100644 --- a/sample-super-rx-databinding/build.gradle +++ b/sample-super-rx-databinding/build.gradle @@ -45,11 +45,11 @@ dependencies { compile 'com.jakewharton:butterknife:' + rootProject.ext.butterKnifeVersion apt 'com.jakewharton:butterknife-compiler:' + rootProject.ext.butterKnifeVersion - compile 'io.reactivex:rxjava:' + rootProject.ext.rxJavaVersion - compile 'io.reactivex:rxandroid:' + rootProject.ext.rxAndroidVersion + compile 'io.reactivex.rxjava2:rxjava:' + rootProject.ext.rxJavaVersion + compile 'io.reactivex.rxjava2:rxandroid:' + rootProject.ext.rxAndroidVersion compile 'com.squareup.retrofit2:retrofit:' + rootProject.ext.retrofitVersion compile 'com.squareup.retrofit2:converter-gson:' + rootProject.ext.retrofitVersion - compile 'com.squareup.retrofit2:adapter-rxjava:' + rootProject.ext.retrofitVersion + compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' compile 'com.squareup.okhttp3:logging-interceptor:' + rootProject.ext.okHttpVersion compile project(path: ':moviper') diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java index d3bcddf..decef41 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/data/retrofit/GitHubApiInterface.java @@ -6,7 +6,7 @@ import retrofit2.http.GET; import retrofit2.http.Path; -import rx.Observable; +import io.reactivex.Observable; /** * Created by jjodelka on 17/10/16. diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java index e549045..11f2e14 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/ListingContract.java @@ -9,8 +9,8 @@ import java.util.List; -import rx.Observable; -import rx.subjects.Subject; +import io.reactivex.Observable; +import io.reactivex.subjects.Subject; public interface ListingContract { diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java index 3ae2128..ddc58ef 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/contract/UserDetailsContract.java @@ -8,8 +8,8 @@ import com.mateuszkoslacz.moviper.iface.viewhelper.ViperViewHelper; import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; -import rx.Observable; -import rx.subjects.Subject; +import io.reactivex.Observable; +import io.reactivex.subjects.Subject; public interface UserDetailsContract { diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java index 39fe109..2c67e76 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/ListingInteractor.java @@ -1,16 +1,16 @@ package com.mateuszkoslacz.moviper.rxsample.viper.interactor; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.base.interactor.BaseRxInteractor; -import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import com.mateuszkoslacz.moviper.rxsample.data.retrofit.GitHubApiInterface; import com.mateuszkoslacz.moviper.rxsample.viper.contract.ListingContract; +import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import java.util.List; +import io.reactivex.Observable; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; public class ListingInteractor extends BaseRxInteractor @@ -22,7 +22,7 @@ public ListingInteractor() { Retrofit mRetrofit = new Retrofit.Builder() .baseUrl(GitHubApiInterface.GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); mGitHubApiInterface = mRetrofit.create(GitHubApiInterface.class); } diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java index 5f47652..87ead81 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/interactor/UserDetailsInteractor.java @@ -1,14 +1,14 @@ package com.mateuszkoslacz.moviper.rxsample.viper.interactor; +import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; import com.mateuszkoslacz.moviper.base.interactor.BaseRxInteractor; -import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; import com.mateuszkoslacz.moviper.rxsample.data.retrofit.GitHubApiInterface; import com.mateuszkoslacz.moviper.rxsample.viper.contract.UserDetailsContract; +import com.mateuszkoslacz.moviper.rxsample.viper.entity.User; +import io.reactivex.Observable; import retrofit2.Retrofit; -import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; import retrofit2.converter.gson.GsonConverterFactory; -import rx.Observable; public class UserDetailsInteractor extends BaseRxInteractor @@ -20,7 +20,7 @@ public UserDetailsInteractor() { final Retrofit retrofit = new Retrofit.Builder() .baseUrl(GitHubApiInterface.GITHUB_API_URL) .addConverterFactory(GsonConverterFactory.create()) - .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .build(); mGitHubApiInterface = retrofit.create(GitHubApiInterface.class); } diff --git a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java index fff15c6..bd3d154 100644 --- a/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java +++ b/sample-super-rx-databinding/src/main/java/com/mateuszkoslacz/moviper/rxsample/viper/presenter/ListingPresenter.java @@ -8,8 +8,8 @@ import com.mateuszkoslacz.moviper.rxsample.viper.interactor.ListingInteractor; import com.mateuszkoslacz.moviper.rxsample.viper.routing.ListingRouting; -import rx.android.schedulers.AndroidSchedulers; -import rx.schedulers.Schedulers; +import io.reactivex.android.schedulers.AndroidSchedulers; +import io.reactivex.schedulers.Schedulers; public class ListingPresenter extends BaseRxPresenter