use of com.example.jingbin.cloudreader.bean.CollectUrlBean in project CloudReader by youlookwhat.
the class CollectLinkModel method getCollectUrlList.
public MutableLiveData<CollectUrlBean> getCollectUrlList() {
final MutableLiveData<CollectUrlBean> data = new MutableLiveData<>();
Disposable subscribe = HttpClient.Builder.getWanAndroidServer().getCollectUrlList().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<CollectUrlBean>() {
@Override
public void accept(CollectUrlBean collectUrlBean) throws Exception {
if (collectUrlBean != null && collectUrlBean.getData() != null && collectUrlBean.getData().size() > 0) {
// 对集合中的数据进行倒叙排序
Collections.reverse(collectUrlBean.getData());
data.setValue(collectUrlBean);
} else {
data.setValue(collectUrlBean);
}
}
}, throwable -> data.setValue(null));
addDisposable(subscribe);
return data;
}
Aggregations