use of rx.Subscription in project ListenerMusicPlayer by hefuyicoder.
the class PlayRankingFragment method subscribeMetaChangedEvent.
private void subscribeMetaChangedEvent() {
Subscription subscription = RxBus.getInstance().toObservable(MetaChangedEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).distinctUntilChanged().subscribe(new Action1<MetaChangedEvent>() {
@Override
public void call(MetaChangedEvent event) {
mAdapter.notifyDataSetChanged();
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
use of rx.Subscription in project ListenerMusicPlayer by hefuyicoder.
the class SearchFragment method subscribeMediaUpdateEvent.
private void subscribeMediaUpdateEvent() {
Subscription subscription = RxBus.getInstance().toObservable(MediaUpdateEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).debounce(1, TimeUnit.SECONDS).subscribe(new Action1<MediaUpdateEvent>() {
@Override
public void call(MediaUpdateEvent event) {
mPresenter.search(queryString);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
use of rx.Subscription in project ListenerMusicPlayer by hefuyicoder.
the class SongsFragment method subscribeRecentlyPlayEvent.
private void subscribeRecentlyPlayEvent() {
Subscription subscription = RxBus.getInstance().toObservable(RecentlyPlayEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<RecentlyPlayEvent>() {
@Override
public void call(RecentlyPlayEvent event) {
mPresenter.loadSongs(action);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
use of rx.Subscription in project ListenerMusicPlayer by hefuyicoder.
the class SongsFragment method subscribeFavourateSongEvent.
private void subscribeFavourateSongEvent() {
Subscription subscription = RxBus.getInstance().toObservable(FavourateSongEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<FavourateSongEvent>() {
@Override
public void call(FavourateSongEvent event) {
mPresenter.loadSongs(action);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
use of rx.Subscription in project ListenerMusicPlayer by hefuyicoder.
the class SongsFragment method subscribeMediaUpdateEvent.
private void subscribeMediaUpdateEvent() {
Subscription subscription = RxBus.getInstance().toObservable(MediaUpdateEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).debounce(1, TimeUnit.SECONDS).subscribe(new Action1<MediaUpdateEvent>() {
@Override
public void call(MediaUpdateEvent event) {
mPresenter.loadSongs(action);
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
Aggregations