Search in sources :

Example 1 with GetPlaylists

use of io.hefuyi.listener.mvp.usecase.GetPlaylists in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistPresenter method loadPlaylist.

@Override
public void loadPlaylist() {
    mCompositeSubscription.clear();
    Subscription subscription = mUsecase.execute(new GetPlaylists.RequestValues(false)).getPlaylists().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<List<Playlist>>() {

        @Override
        public void call(List<Playlist> playlists) {
            if (playlists == null || playlists.size() == 0) {
                mView.showEmptyView();
            } else {
                mView.showPlaylist(playlists);
            }
        }
    });
    mCompositeSubscription.add(subscription);
}
Also used : Playlist(io.hefuyi.listener.mvp.model.Playlist) GetPlaylists(io.hefuyi.listener.mvp.usecase.GetPlaylists) List(java.util.List) CompositeSubscription(rx.subscriptions.CompositeSubscription) Subscription(rx.Subscription)

Aggregations

Playlist (io.hefuyi.listener.mvp.model.Playlist)1 GetPlaylists (io.hefuyi.listener.mvp.usecase.GetPlaylists)1 List (java.util.List)1 Subscription (rx.Subscription)1 CompositeSubscription (rx.subscriptions.CompositeSubscription)1