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);
}
Aggregations