Example #1
0
 public void waitForBackgroundLoading(@Nullable final CancellableHandler handler) {
   if (handler != null) {
     handler.unsubscribeIfCancelled(subscription);
   }
   loading.onCompleted();
   waitForEnd.toBlockingObservable().lastOrDefault(null);
 }
Example #2
0
 @Nullable
 @Override
 public BitmapDrawable getDrawable(final String url) {
   final Observable<BitmapDrawable> drawable = fetchDrawable(url);
   if (onlySave) {
     loading.onNext(
         drawable.map(
             new Func1<BitmapDrawable, String>() {
               @Override
               public String call(final BitmapDrawable bitmapDrawable) {
                 return url;
               }
             }));
     return null;
   } else {
     return drawable.toBlockingObservable().lastOrDefault(null);
   }
 }