use of rx.subscriptions.CompositeSubscription in project ListenerMusicPlayer by hefuyicoder.
the class FolderPresenter method attachView.
@Override
public void attachView(FoldersContract.View view) {
this.mView = view;
mCompositeSubscription = new CompositeSubscription();
}
use of rx.subscriptions.CompositeSubscription in project ListenerMusicPlayer by hefuyicoder.
the class SongsPresenter method attachView.
@Override
public void attachView(SongsContract.View view) {
mView = view;
mCompositeSubscription = new CompositeSubscription();
}
use of rx.subscriptions.CompositeSubscription in project realm-rxjava-example by kboyarshinov.
the class MainActivity method addNewIssue.
private void addNewIssue() {
if (compositeSubscription == null) {
return;
}
String title = "Feature request: removing issues";
String body = "Add function to remove issues";
User user = new User("kboyarshinov");
List<Label> labels = new ArrayList<>();
labels.add(new Label("feature", "FF5722"));
Subscription subscription = dataService.newIssue(title, body, user, labels).observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Action1<Issue>() {
@Override
public void call(Issue issue) {
Log.d(TAG, "Issue with title " + issue.getTitle() + " successfully saved");
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
Log.e(TAG, "Add new issue error", throwable);
}
});
compositeSubscription.add(subscription);
}
use of rx.subscriptions.CompositeSubscription in project realm-rxjava-example by kboyarshinov.
the class MainActivity method requestAllIssues.
private void requestAllIssues() {
if (compositeSubscription == null) {
return;
}
Subscription subscription = dataService.issuesList().observeOn(AndroidSchedulers.mainThread()).subscribeOn(Schedulers.io()).subscribe(new Action1<List<Issue>>() {
@Override
public void call(List<Issue> issues) {
Log.d(TAG, "Issues received with size " + issues.size());
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
Log.e(TAG, "Request all issues error", throwable);
}
});
compositeSubscription.add(subscription);
}
use of rx.subscriptions.CompositeSubscription in project Shuttle by timusus.
the class SearchActivity method onResume.
@Override
protected void onResume() {
super.onResume();
if (subscriptions == null || subscriptions.isUnsubscribed()) {
subscriptions = new CompositeSubscription();
}
refreshAdapterItems();
if (searchView != null) {
subscriptions.add(getSearchViewSubscription());
}
}
Aggregations