Search in sources :

Example 1 with SongDetailResult

use of com.xinshang.audient.model.entities.SongDetailResult in project Audient by komamj.

the class AuditionPresenter method loadAudient.

@Override
public void loadAudient(String id) {
    Disposable disposable = mRepository.getSongDetailResult(id).map(new Function<SongDetailResult, Audient>() {

        @Override
        public Audient apply(SongDetailResult songDetailResult) throws Exception {
            return songDetailResult.audient;
        }
    }).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribeWith(new DisposableSubscriber<Audient>() {

        @Override
        public void onNext(Audient audient) {
            mView.showAudient(audient);
        }

        @Override
        public void onError(Throwable t) {
            LogUtils.e(TAG, "loadNowPlaying onError:" + t.toString());
        }

        @Override
        public void onComplete() {
        }
    });
    mDisposables.add(disposable);
}
Also used : CompositeDisposable(io.reactivex.disposables.CompositeDisposable) Disposable(io.reactivex.disposables.Disposable) Function(io.reactivex.functions.Function) SongDetailResult(com.xinshang.audient.model.entities.SongDetailResult) Audient(com.xinshang.audient.model.entities.Audient)

Aggregations

Audient (com.xinshang.audient.model.entities.Audient)1 SongDetailResult (com.xinshang.audient.model.entities.SongDetailResult)1 CompositeDisposable (io.reactivex.disposables.CompositeDisposable)1 Disposable (io.reactivex.disposables.Disposable)1 Function (io.reactivex.functions.Function)1