This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package haibuzou.rxjavabook.bean; | |
| import android.graphics.drawable.Drawable; | |
| public class AppInfo implements Comparable<Object> { | |
| // long mLastUpdateTime; | |
| public String mName; | |
| public Drawable mIcon; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private ObservableManager obsManager = new ObservableManager(EventBus.getDefault()); | |
| @Override | |
| public Subscription getStores() { | |
| // Get the observable if exists and is not too old | |
| Observable<StoresList> observable = obsManager.get(ObservableManager.Types.STORES); | |
| if (observable == null) { | |
| // If is null create it and us cache to keep it in memeroy | |
| observable = api.getStoresList() | |
| .compose(applySchedulers(api.getStoresList())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.mozu.mozuandroidinstoreassistant.app.loaders; | |
| import com.mozu.api.MozuApiContext; | |
| import com.mozu.api.contracts.productadmin.LocationInventoryCollection; | |
| import com.mozu.api.contracts.productruntime.Product; | |
| import com.mozu.api.resources.commerce.catalog.admin.products.LocationInventoryResource; | |
| import rx.Observable; | |
| import rx.Subscriber; | |
| import rx.android.schedulers.AndroidSchedulers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Wrapper for {@link AccountManager} with improved functionality and RxJava support. | |
| * | |
| * Originally found from <a href="https://github.com/novoda/spikes/tree/master/gertherb/android/src/main/java/com/gertherb/authentication">github.com/spikes/gertherb</a>, | |
| * and modified to work with a newer RxJava version, using {@link Single} instead of {@link rx.Observable}. | |
| * | |
| * @author Ataul Munim | |
| * @author Santeri Elo | |
| */ | |
| public class BetterAccountManager { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private Subscription mDoSomethingSubscription; | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(...); | |
| // Setup views | |
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| port android.app.Activity; | |
| import android.os.Bundle; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import club.smartsavers.presenters.SignUpPresenter; | |
| import club.smartsavers.presenters.SignUpPresenterImpl; | |
| import com.jakewharton.rxbinding.widget.RxTextView; | |
| import rx.Observable; | |
| public class SignUpActivity extends Activity implements SignUpView { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.vinaysshenoy.utils; | |
| import android.support.annotation.NonNull; | |
| import android.support.v4.util.Pair; | |
| import java.lang.reflect.Type; | |
| import java.util.ArrayList; | |
| import java.util.HashMap; | |
| import java.util.List; | |
| import java.util.Map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface AvailabilityChecker { | |
| Observable<ValidationResult<String>> isEmailAvailable(@NonNull String email); | |
| Observable<ValidationResult<String>> isUsernameAvailable(@NonNull String email); | |
| ValidationResult<String> isEmailAvailableSync(@NonNull String email); | |
| ValidationResult<String> isUsernameAvailableSync(@NonNull String email); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.media.MediaRecorder; | |
| import android.support.annotation.NonNull; | |
| import com.f2prateek.rx.android.schedulers.AndroidSchedulers; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.concurrent.TimeUnit; | |
| import rx.Observable; | |
| import rx.subscriptions.Subscriptions; | |
| public class RxMediaRecorder { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FragmentRepos extends DefaultListFragment { | |
| @Override | |
| public void onViewCreated(View view, Bundle savedInstanceState) { | |
| super.onViewCreated(view, savedInstanceState); | |
| GithubClient client = new GithubClient(true); | |
| RepoService repoService = client.createService(RepoService.class); | |
| Observable<List<Repo>> repos = repoService.getRepos("fnk0"); | |
| AppObservable.bindFragment(this, repos); | |
| repos.subscribeOn(Schedulers.io()) | |
| .observeOn(AndroidSchedulers.mainThread()) |