Search in sources :

Example 1 with MetaChangedEvent

use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.

the class ArtistMusicFragment 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) {
            mSongAdapter.notifyDataSetChanged();
        }
    }, new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
        }
    });
    RxBus.getInstance().addSubscription(this, subscription);
}
Also used : MetaChangedEvent(io.hefuyi.listener.event.MetaChangedEvent) Subscription(rx.Subscription)

Example 2 with MetaChangedEvent

use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistDetailFragment 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);
}
Also used : MetaChangedEvent(io.hefuyi.listener.event.MetaChangedEvent) Subscription(rx.Subscription)

Example 3 with MetaChangedEvent

use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.

the class QuickControlsFragment method subscribeMetaChangedEvent.

private void subscribeMetaChangedEvent() {
    Subscription subscription = RxBus.getInstance().toObservable(MetaChangedEvent.class).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<MetaChangedEvent>() {

        @Override
        public void call(MetaChangedEvent event) {
            mPresenter.updateNowPlayingCard();
            mPresenter.loadLyric();
        }
    }, new Action1<Throwable>() {

        @Override
        public void call(Throwable throwable) {
        }
    });
    RxBus.getInstance().addSubscription(this, subscription);
}
Also used : MetaChangedEvent(io.hefuyi.listener.event.MetaChangedEvent) Subscription(rx.Subscription)

Example 4 with MetaChangedEvent

use of io.hefuyi.listener.event.MetaChangedEvent in project ListenerMusicPlayer by hefuyicoder.

the class FoldersFragment 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);
}
Also used : MetaChangedEvent(io.hefuyi.listener.event.MetaChangedEvent) Subscription(rx.Subscription)

Example 5 with MetaChangedEvent

use of io.hefuyi.listener.event.MetaChangedEvent 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);
}
Also used : MetaChangedEvent(io.hefuyi.listener.event.MetaChangedEvent) Subscription(rx.Subscription)

Aggregations

MetaChangedEvent (io.hefuyi.listener.event.MetaChangedEvent)10 Subscription (rx.Subscription)10