From 05319464d77ce782bf781849d56c7ad773470410 Mon Sep 17 00:00:00 2001 From: Ferran Pons Date: Tue, 28 Nov 2017 09:10:05 +0100 Subject: [PATCH] Upgraded RxLint (#125) --- leku/build.gradle | 2 +- .../com/schibstedspain/leku/geocoder/GeocoderPresenter.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/leku/build.gradle b/leku/build.gradle index 4ece55e4..b8635da1 100644 --- a/leku/build.gradle +++ b/leku/build.gradle @@ -56,7 +56,7 @@ dependencies { implementation "io.reactivex:rxandroid:1.2.1" implementation 'io.reactivex.rxjava2:rxjava:2.1.6' implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' - implementation 'nl.littlerobots.rxlint:rxlint:1.5' + implementation 'nl.littlerobots.rxlint:rxlint:1.6' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' androidTestImplementation 'com.android.support.test:runner:1.0.1' diff --git a/leku/src/main/java/com/schibstedspain/leku/geocoder/GeocoderPresenter.java b/leku/src/main/java/com/schibstedspain/leku/geocoder/GeocoderPresenter.java index 46d22e43..7bb87c46 100644 --- a/leku/src/main/java/com/schibstedspain/leku/geocoder/GeocoderPresenter.java +++ b/leku/src/main/java/com/schibstedspain/leku/geocoder/GeocoderPresenter.java @@ -7,6 +7,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.Disposable; +import io.reactivex.schedulers.Schedulers; import java.util.concurrent.TimeUnit; import pl.charmas.android.reactivelocation2.ReactiveLocationProvider; @@ -73,7 +74,7 @@ public void getFromLocationName(String query, LatLng lowerLeft, LatLng upperRigh public void getDebouncedFromLocationName(String query, int debounceTime) { view.willLoadLocation(); Disposable disposable = geocoderRepository.getFromLocationName(query) - .debounce(debounceTime, TimeUnit.MILLISECONDS) + .debounce(debounceTime, TimeUnit.MILLISECONDS, Schedulers.io()) .observeOn(scheduler) .subscribe(view::showDebouncedLocations, throwable -> view.showLoadLocationError(), view::didLoadLocation); @@ -83,7 +84,7 @@ public void getDebouncedFromLocationName(String query, int debounceTime) { public void getDebouncedFromLocationName(String query, LatLng lowerLeft, LatLng upperRight, int debounceTime) { view.willLoadLocation(); Disposable disposable = geocoderRepository.getFromLocationName(query, lowerLeft, upperRight) - .debounce(debounceTime, TimeUnit.MILLISECONDS) + .debounce(debounceTime, TimeUnit.MILLISECONDS, Schedulers.io()) .observeOn(scheduler) .subscribe(view::showDebouncedLocations, throwable -> view.showLoadLocationError(), view::didLoadLocation);