use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.
the class SongsFragment 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 io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.
the class FolderSongsFragment 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 io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.
the class PanelSlideListener 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) {
caculateTitleAndArtist();
if (TextUtils.isEmpty(MusicPlayer.getTrackName()) || TextUtils.isEmpty(MusicPlayer.getArtistName())) {
if (mStatus == Status.EXPANDED || mStatus == Status.FULLSCREEN) {
mPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
mPanelLayout.setTouchEnabled(false);
} else {
mPanelLayout.setTouchEnabled(true);
}
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.
the class AlbumDetailFragment 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 io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.
the class MainActivity 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) {
setDetailsToHeader();
}
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
}
});
RxBus.getInstance().addSubscription(this, subscription);
}
Aggregations