Search in sources :

Example 1 with WXHttpResponse

use of com.codeest.geeknews.model.http.response.WXHttpResponse in project GeekNews by codeestX.

the class WechatPresenter method getMoreWechatData.

@Override
public void getMoreWechatData() {
    Observable<WXHttpResponse<List<WXItemBean>>> observable;
    if (queryStr != null) {
        observable = mRetrofitHelper.fetchWechatSearchListInfo(NUM_OF_PAGE, ++currentPage, queryStr);
    } else {
        observable = mRetrofitHelper.fetchWechatListInfo(NUM_OF_PAGE, ++currentPage);
    }
    Subscription rxSubscription = observable.compose(RxUtil.<WXHttpResponse<List<WXItemBean>>>rxSchedulerHelper()).compose(RxUtil.<List<WXItemBean>>handleWXResult()).subscribe(new CommonSubscriber<List<WXItemBean>>(mView, "没有更多了ヽ(≧Д≦)ノ") {

        @Override
        public void onNext(List<WXItemBean> wxItemBeen) {
            mView.showMoreContent(wxItemBeen);
        }
    });
    addSubscrebe(rxSubscription);
}
Also used : WXHttpResponse(com.codeest.geeknews.model.http.response.WXHttpResponse) WXItemBean(com.codeest.geeknews.model.bean.WXItemBean) List(java.util.List) Subscription(rx.Subscription)

Aggregations

WXItemBean (com.codeest.geeknews.model.bean.WXItemBean)1 WXHttpResponse (com.codeest.geeknews.model.http.response.WXHttpResponse)1 List (java.util.List)1 Subscription (rx.Subscription)1