diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2015-01-08 17:16:57 +0100 |
---|---|---|
committer | Samuel Tardieu <sam@rfc1149.net> | 2015-01-08 17:38:36 +0100 |
commit | 8d8a9d9a5e0e6294a61700b687726da37c672cf6 (patch) | |
tree | 36dfd8abe6eb17163955703e5a65c8847741b414 /main/src/cgeo | |
parent | f5891b88b3a87a230f2b0d68230ef8e6842b4734 (diff) | |
download | cgeo-8d8a9d9a5e0e6294a61700b687726da37c672cf6.zip cgeo-8d8a9d9a5e0e6294a61700b687726da37c672cf6.tar.gz cgeo-8d8a9d9a5e0e6294a61700b687726da37c672cf6.tar.bz2 |
Revert "Use bindView instead of bindActivity/bindFragment where appropriate"
This reverts commit d3dc2be5040ea3f4846d9b948c3a0f95b9359f71 and fixes #4604.
Conflicts:
main/src/cgeo/geocaching/MainActivity.java
Diffstat (limited to 'main/src/cgeo')
-rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 4 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/MainActivity.java | 8 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/StatusFragment.java | 4 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/TrackableActivity.java | 2 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java | 4 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/ui/ImagesList.java | 4 |
6 files changed, 14 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 9406fd4..2be802f 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -66,7 +66,7 @@ import rx.Observable; import rx.Observable.OnSubscribe; import rx.Subscriber; import rx.Subscription; -import rx.android.view.ViewObservable; +import rx.android.app.AppObservable; import rx.functions.Action0; import rx.functions.Action1; import rx.subscriptions.CompositeSubscription; @@ -807,7 +807,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc view = (ScrollView) getLayoutInflater().inflate(R.layout.cachedetail_details_page, parentView, false); // Start loading preview map - ViewObservable.bindView(view, previewMap).subscribeOn(RxUtils.networkScheduler) + AppObservable.bindActivity(CacheDetailActivity.this, previewMap).subscribeOn(RxUtils.networkScheduler) .subscribe(new Action1<BitmapDrawable>() { @Override public void call(final BitmapDrawable image) { diff --git a/main/src/cgeo/geocaching/MainActivity.java b/main/src/cgeo/geocaching/MainActivity.java index 399de83..85ae585 100644 --- a/main/src/cgeo/geocaching/MainActivity.java +++ b/main/src/cgeo/geocaching/MainActivity.java @@ -39,8 +39,8 @@ import com.google.zxing.integration.android.IntentResult; import org.apache.commons.lang3.StringUtils; import rx.Observable; +import rx.android.app.AppObservable; import rx.android.schedulers.AndroidSchedulers; -import rx.android.view.ViewObservable; import rx.functions.Action0; import rx.functions.Action1; import rx.functions.Func1; @@ -500,7 +500,7 @@ public class MainActivity extends AbstractActionBarActivity { } public void updateCacheCounter() { - ViewObservable.bindView(countBubble, DataStore.getAllCachesCountObservable()).subscribe(new Action1<Integer>() { + AppObservable.bindActivity(this, DataStore.getAllCachesCountObservable()).subscribe(new Action1<Integer>() { @Override public void call(final Integer countBubbleCnt1) { if (countBubbleCnt1 == 0) { @@ -585,7 +585,9 @@ public class MainActivity extends AbstractActionBarActivity { return formatAddress(address); } }).onErrorResumeNext(Observable.just(currentCoords.toString())); - ViewObservable.bindView(navLocation, address).subscribe(new Action1<String>() { + AppObservable.bindActivity(MainActivity.this, address) + .subscribeOn(RxUtils.networkScheduler) + .subscribe(new Action1<String>() { @Override public void call(final String address) { navLocation.setText(address); diff --git a/main/src/cgeo/geocaching/StatusFragment.java b/main/src/cgeo/geocaching/StatusFragment.java index 76e841d..acc7011 100644 --- a/main/src/cgeo/geocaching/StatusFragment.java +++ b/main/src/cgeo/geocaching/StatusFragment.java @@ -8,7 +8,7 @@ import cgeo.geocaching.network.StatusUpdater.Status; import cgeo.geocaching.utils.Log; import rx.Subscription; -import rx.android.view.ViewObservable; +import rx.android.app.AppObservable; import rx.functions.Action1; import rx.subscriptions.Subscriptions; @@ -36,7 +36,7 @@ public class StatusFragment extends Fragment { super.onCreateView(inflater, container, savedInstanceState); final ViewGroup statusGroup = (ViewGroup) inflater.inflate(R.layout.status, container, false); ButterKnife.inject(this, statusGroup); - statusSubscription = ViewObservable.bindView(statusGroup, StatusUpdater.latestStatus) + statusSubscription = AppObservable.bindFragment(this, StatusUpdater.latestStatus) .subscribe(new Action1<Status>() { @Override public void call(final Status status) { diff --git a/main/src/cgeo/geocaching/TrackableActivity.java b/main/src/cgeo/geocaching/TrackableActivity.java index ff84dcb..c6d5bed 100644 --- a/main/src/cgeo/geocaching/TrackableActivity.java +++ b/main/src/cgeo/geocaching/TrackableActivity.java @@ -534,7 +534,7 @@ public class TrackableActivity extends AbstractViewPagerActivity<TrackableActivi } }); - ViewObservable.bindView(trackableImage, new HtmlImage(geocode, true, 0, false).fetchDrawable(trackable.getImage())).subscribe(new Action1<BitmapDrawable>() { + AppObservable.bindActivity(TrackableActivity.this, new HtmlImage(geocode, true, 0, false).fetchDrawable(trackable.getImage())).subscribe(new Action1<BitmapDrawable>() { @Override public void call(final BitmapDrawable bitmapDrawable) { trackableImage.setImageDrawable(bitmapDrawable); diff --git a/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java b/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java index 5fc3c2b..1258ddd 100644 --- a/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java +++ b/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java @@ -11,7 +11,7 @@ import cgeo.geocaching.utils.RxUtils; import org.apache.commons.io.IOUtils; import rx.Observable; -import rx.android.view.ViewObservable; +import rx.android.app.AppObservable; import rx.functions.Action1; import rx.functions.Func0; @@ -64,7 +64,7 @@ public class RecaptchaHandler extends Handler { return Observable.empty(); } }); - ViewObservable.bindView(imageView, captcha).subscribeOn(RxUtils.networkScheduler).subscribe(new Action1<Bitmap>() { + AppObservable.bindActivity(activity, captcha).subscribeOn(RxUtils.networkScheduler).subscribe(new Action1<Bitmap>() { @Override public void call(final Bitmap bitmap) { imageView.setImageBitmap(bitmap); diff --git a/main/src/cgeo/geocaching/ui/ImagesList.java b/main/src/cgeo/geocaching/ui/ImagesList.java index 0126258..27a68c7 100644 --- a/main/src/cgeo/geocaching/ui/ImagesList.java +++ b/main/src/cgeo/geocaching/ui/ImagesList.java @@ -13,7 +13,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import rx.Subscription; -import rx.android.view.ViewObservable; +import rx.android.app.AppObservable; import rx.functions.Action0; import rx.functions.Action1; import rx.subscriptions.CompositeSubscription; @@ -122,7 +122,7 @@ public class ImagesList { final ImageView imageView = (ImageView) inflater.inflate(R.layout.image_item, rowView, false); assert imageView != null; - subscriptions.add(ViewObservable.bindView(imageView, imgGetter.fetchDrawable(img.getUrl())).subscribe(new Action1<BitmapDrawable>() { + subscriptions.add(AppObservable.bindActivity(activity, imgGetter.fetchDrawable(img.getUrl())).subscribe(new Action1<BitmapDrawable>() { @Override public void call(final BitmapDrawable image) { display(imageView, image, img, rowView); |