Search in sources :

Example 16 with PlayList

use of io.github.ryanhoo.music.data.model.PlayList in project StylishMusicPlayer by ryanhoo.

the class PlayListPresenter method deletePlayList.

@Override
public void deletePlayList(PlayList playList) {
    Subscription subscription = mRepository.delete(playList).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber<PlayList>() {

        @Override
        public void onStart() {
            mView.showLoading();
        }

        @Override
        public void onCompleted() {
            mView.hideLoading();
        }

        @Override
        public void onError(Throwable e) {
            mView.hideLoading();
            mView.handleError(e);
        }

        @Override
        public void onNext(PlayList playList) {
            mView.onPlayListDeleted(playList);
        }
    });
    mSubscriptions.add(subscription);
}
Also used : PlayList(io.github.ryanhoo.music.data.model.PlayList) CompositeSubscription(rx.subscriptions.CompositeSubscription) Subscription(rx.Subscription)

Aggregations

PlayList (io.github.ryanhoo.music.data.model.PlayList)16 Subscription (rx.Subscription)8 CompositeSubscription (rx.subscriptions.CompositeSubscription)8 PopupMenu (android.support.v7.widget.PopupMenu)3 PlayListUpdatedEvent (io.github.ryanhoo.music.event.PlayListUpdatedEvent)3 Song (io.github.ryanhoo.music.data.model.Song)2 AddToPlayListDialogFragment (io.github.ryanhoo.music.ui.playlist.AddToPlayListDialogFragment)2 MenuItem (android.view.MenuItem)1 Folder (io.github.ryanhoo.music.data.model.Folder)1 PlayListNowEvent (io.github.ryanhoo.music.event.PlayListNowEvent)1 OnItemClickListener (io.github.ryanhoo.music.ui.base.adapter.OnItemClickListener)1 DefaultDividerDecoration (io.github.ryanhoo.music.ui.common.DefaultDividerDecoration)1 EditPlayListDialogFragment (io.github.ryanhoo.music.ui.playlist.EditPlayListDialogFragment)1 List (java.util.List)1