use of com.codeest.geeknews.model.bean.DailyListBean in project GeekNews by codeestX.
the class DailyPresenter method getDailyData.
@Override
public void getDailyData() {
Subscription rxSubscription = mRetrofitHelper.fetchDailyListInfo().compose(RxUtil.<DailyListBean>rxSchedulerHelper()).map(new Func1<DailyListBean, DailyListBean>() {
@Override
public DailyListBean call(DailyListBean dailyListBean) {
List<DailyListBean.StoriesBean> list = dailyListBean.getStories();
for (DailyListBean.StoriesBean item : list) {
item.setReadState(mRealmHelper.queryNewsId(item.getId()));
}
return dailyListBean;
}
}).subscribe(new CommonSubscriber<DailyListBean>(mView) {
@Override
public void onNext(DailyListBean dailyListBean) {
topCount = dailyListBean.getTop_stories().size();
mView.showContent(dailyListBean);
}
});
addSubscrebe(rxSubscription);
}
Aggregations