diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-04-05 14:55:40 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-04-05 18:23:20 +0200 |
| commit | cca4c9b0bcc1bd7742d419166fd5cfd5415fde9e (patch) | |
| tree | 5c88f703e8130e07ff98e0f13277a8fddc44d2b1 /main/src/cgeo/geocaching/network | |
| parent | de71f9ba50bf7ee8f8987402b52912b014c5b460 (diff) | |
| download | cgeo-cca4c9b0bcc1bd7742d419166fd5cfd5415fde9e.zip cgeo-cca4c9b0bcc1bd7742d419166fd5cfd5415fde9e.tar.gz cgeo-cca4c9b0bcc1bd7742d419166fd5cfd5415fde9e.tar.bz2 | |
Do not use AndroidObservable
This lets us return to an unmodified version of RxJava.
Diffstat (limited to 'main/src/cgeo/geocaching/network')
| -rw-r--r-- | main/src/cgeo/geocaching/network/HtmlImage.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java index 5d713eb..bde85ee 100644 --- a/main/src/cgeo/geocaching/network/HtmlImage.java +++ b/main/src/cgeo/geocaching/network/HtmlImage.java @@ -10,6 +10,7 @@ import cgeo.geocaching.utils.CancellableHandler; import cgeo.geocaching.utils.FileUtils; import cgeo.geocaching.utils.ImageUtils; import cgeo.geocaching.utils.Log; +import cgeo.geocaching.utils.RxUtils; import ch.boye.httpclientandroidlib.HttpResponse; import ch.boye.httpclientandroidlib.androidextra.Base64; @@ -127,9 +128,8 @@ public class HtmlImage implements Html.ImageGetter { return drawable.toBlockingObservable().lastOrDefault(null); } - // Caches are loaded from disk on Schedulers.computation() to avoid using more threads than processors - // on the phone while decoding the image. Downloads happen on downloadScheduler, in parallel with image - // decoding. + // Caches are loaded from disk on a computation scheduler to avoid using more threads than cores while decoding + // the image. Downloads happen on downloadScheduler, in parallel with image decoding. public Observable<BitmapDrawable> fetchDrawable(final String url) { if (StringUtils.isBlank(url) || ImageUtils.containsPattern(url, BLOCKED)) { @@ -143,7 +143,7 @@ public class HtmlImage implements Html.ImageGetter { @Override public void call(final Subscriber<? super BitmapDrawable> subscriber) { subscription.add(subscriber); - subscriber.add(Schedulers.computation().schedule(new Action1<Inner>() { + subscriber.add(RxUtils.computationScheduler.schedule(new Action1<Inner>() { @Override public void call(final Inner inner) { final Pair<BitmapDrawable, Boolean> loaded = loadFromDisk(); @@ -195,7 +195,7 @@ public class HtmlImage implements Html.ImageGetter { if (onlySave) { subscriber.onCompleted(); } else { - Schedulers.computation().schedule(new Action1<Inner>() { + RxUtils.computationScheduler.schedule(new Action1<Inner>() { @Override public void call(final Inner inner) { final Pair<BitmapDrawable, Boolean> loaded = loadFromDisk(); |
