use of com.codeest.geeknews.model.bean.GankItemBean in project GeekNews by codeestX.
the class GirlPresenter method getMoreGirlData.
@Override
public void getMoreGirlData() {
Subscription rxSubscription = mRetrofitHelper.fetchGirlList(NUM_OF_PAGE, ++currentPage).compose(RxUtil.<GankHttpResponse<List<GankItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<GankItemBean>>handleResult()).subscribe(new CommonSubscriber<List<GankItemBean>>(mView) {
@Override
public void onNext(List<GankItemBean> gankItemBeen) {
mView.showMoreContent(gankItemBeen);
}
});
addSubscrebe(rxSubscription);
}
use of com.codeest.geeknews.model.bean.GankItemBean in project GeekNews by codeestX.
the class TechPresenter method getGirlImage.
@Override
public void getGirlImage() {
Subscription rxSubscription = mRetrofitHelper.fetchRandomGirl(1).compose(RxUtil.<GankHttpResponse<List<GankItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<GankItemBean>>handleResult()).subscribe(new CommonSubscriber<List<GankItemBean>>(mView, "加载封面失败") {
@Override
public void onNext(List<GankItemBean> gankItemBean) {
mView.showGirlImage(gankItemBean.get(0).getUrl(), gankItemBean.get(0).getWho());
}
});
addSubscrebe(rxSubscription);
}
use of com.codeest.geeknews.model.bean.GankItemBean in project GeekNews by codeestX.
the class TechPresenter method getSearchTechData.
private void getSearchTechData() {
currentPage = 1;
Subscription rxSubscription = mRetrofitHelper.fetchGankSearchList(queryStr, currentTech, NUM_OF_PAGE, currentPage).compose(RxUtil.<GankHttpResponse<List<GankSearchItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<GankSearchItemBean>>handleResult()).map(new Func1<List<GankSearchItemBean>, List<GankItemBean>>() {
@Override
public List<GankItemBean> call(List<GankSearchItemBean> gankSearchItemBeen) {
List<GankItemBean> newList = new ArrayList<>();
for (GankSearchItemBean item : gankSearchItemBeen) {
GankItemBean bean = new GankItemBean();
bean.set_id(item.getGanhuo_id());
bean.setDesc(item.getDesc());
bean.setPublishedAt(item.getPublishedAt());
bean.setWho(item.getWho());
bean.setUrl(item.getUrl());
newList.add(bean);
}
return newList;
}
}).subscribe(new CommonSubscriber<List<GankItemBean>>(mView) {
@Override
public void onNext(List<GankItemBean> gankItemBeen) {
mView.showContent(gankItemBeen);
}
});
addSubscrebe(rxSubscription);
}
use of com.codeest.geeknews.model.bean.GankItemBean in project GeekNews by codeestX.
the class GirlPresenter method getGirlData.
@Override
public void getGirlData() {
currentPage = 1;
Subscription rxSubscription = mRetrofitHelper.fetchGirlList(NUM_OF_PAGE, currentPage).compose(RxUtil.<GankHttpResponse<List<GankItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<GankItemBean>>handleResult()).subscribe(new CommonSubscriber<List<GankItemBean>>(mView) {
@Override
public void onNext(List<GankItemBean> gankItemBeen) {
mView.showContent(gankItemBeen);
}
});
addSubscrebe(rxSubscription);
}
use of com.codeest.geeknews.model.bean.GankItemBean in project GeekNews by codeestX.
the class TechPresenter method getMoreGankData.
@Override
public void getMoreGankData(String tech) {
if (queryStr != null) {
getMoreSearchGankData();
return;
}
Subscription rxSubscription = mRetrofitHelper.fetchTechList(tech, NUM_OF_PAGE, ++currentPage).compose(RxUtil.<GankHttpResponse<List<GankItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<GankItemBean>>handleResult()).subscribe(new CommonSubscriber<List<GankItemBean>>(mView, "加载更多数据失败ヽ(≧Д≦)ノ") {
@Override
public void onNext(List<GankItemBean> gankItemBeen) {
mView.showMoreContent(gankItemBeen);
}
});
addSubscrebe(rxSubscription);
}
Aggregations