Search in sources :

Example 1 with WXItemBean

use of com.codeest.geeknews.model.bean.WXItemBean in project GeekNews by codeestX.

the class WechatPresenter method getWechatData.

@Override
public void getWechatData() {
    queryStr = null;
    currentPage = 1;
    Subscription rxSubscription = mRetrofitHelper.fetchWechatListInfo(NUM_OF_PAGE, currentPage).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.showContent(wxItemBeen);
        }
    });
    addSubscrebe(rxSubscription);
}
Also used : WXItemBean(com.codeest.geeknews.model.bean.WXItemBean) List(java.util.List) Subscription(rx.Subscription)

Example 2 with WXItemBean

use of com.codeest.geeknews.model.bean.WXItemBean 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)

Example 3 with WXItemBean

use of com.codeest.geeknews.model.bean.WXItemBean in project GeekNews by codeestX.

the class WechatPresenter method getSearchWechatData.

private void getSearchWechatData(String query) {
    currentPage = 1;
    Subscription rxSubscription = mRetrofitHelper.fetchWechatSearchListInfo(NUM_OF_PAGE, currentPage, query).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.showContent(wxItemBeen);
        }
    });
    addSubscrebe(rxSubscription);
}
Also used : WXItemBean(com.codeest.geeknews.model.bean.WXItemBean) List(java.util.List) Subscription(rx.Subscription)

Aggregations

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