diff options
Diffstat (limited to 'main/src/cgeo/geocaching/utils')
| -rw-r--r-- | main/src/cgeo/geocaching/utils/ImageUtils.java | 8 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/utils/RxUtils.java | 33 |
2 files changed, 5 insertions, 36 deletions
diff --git a/main/src/cgeo/geocaching/utils/ImageUtils.java b/main/src/cgeo/geocaching/utils/ImageUtils.java index e226703..ffb7bf3 100644 --- a/main/src/cgeo/geocaching/utils/ImageUtils.java +++ b/main/src/cgeo/geocaching/utils/ImageUtils.java @@ -273,9 +273,11 @@ public final class ImageUtils { /** * Decode a base64-encoded string and save the result into a stream. - * - * @param inString the encoded string - * @param outFile the file to save the decoded result into + * + * @param inString + * the encoded string + * @param out + * the stream to save the decoded result into */ public static void decodeBase64ToStream(final String inString, final OutputStream out) throws IOException { Base64InputStream in = null; diff --git a/main/src/cgeo/geocaching/utils/RxUtils.java b/main/src/cgeo/geocaching/utils/RxUtils.java index 9926bab..8e7864c 100644 --- a/main/src/cgeo/geocaching/utils/RxUtils.java +++ b/main/src/cgeo/geocaching/utils/RxUtils.java @@ -1,11 +1,6 @@ package cgeo.geocaching.utils; -import rx.Observable; -import rx.Observer; import rx.Scheduler; -import rx.Subscription; -import rx.android.schedulers.AndroidSchedulers; -import rx.functions.Action1; import rx.schedulers.Schedulers; import java.util.concurrent.LinkedBlockingQueue; @@ -20,32 +15,4 @@ public class RxUtils { final static private int cores = Runtime.getRuntime().availableProcessors(); public final static Scheduler computationScheduler = Schedulers.executor(new ThreadPoolExecutor(1, cores, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>())); - public static <T> Subscription subscribeThenUI(final Observable<T> observable, final Observer<T> observer) { - return observable.observeOn(AndroidSchedulers.mainThread()).subscribe(observer); - } - - public static <T> Subscription subscribeThenUI(final Observable<T> observable, final Action1<T> action) { - return observable.observeOn(AndroidSchedulers.mainThread()).subscribe(action); - } - - public static <T> Subscription subscribeThenUI(final Observable<T> observable, final Action1<T> action, final Action1<Throwable> onError) { - return observable.observeOn(AndroidSchedulers.mainThread()).subscribe(action, onError); - } - - public static <T> Observable<T> onIO(final Observable<T> observable) { - return observable.subscribeOn(Schedulers.io()); - } - - public static <T> Subscription subscribeOnIOThenUI(final Observable<T> observable, final Observer<T> observer) { - return subscribeThenUI(onIO(observable), observer); - } - - public static <T> Subscription subscribeOnIOThenUI(final Observable<T> observable, final Action1<T> action) { - return subscribeThenUI(onIO(observable), action); - } - - public static <T> Subscription subscribeOnIOThenUI(final Observable<T> observable, final Action1<T> action, final Action1<Throwable> onError) { - return subscribeThenUI(onIO(observable), action, onError); - } - } |
