Search in sources :

Example 1 with NewsList

use of com.looklook.xinghongfei.looklook.bean.news.NewsList in project LookLook by xinghongfei.

the class TopNewsPrensenterImpl method getNewsList.

@Override
public void getNewsList(int t) {
    mITopNewsFragment.showProgressDialog();
    Subscription subscription = ApiManage.getInstence().getTopNewsService().getNews(t).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<NewsList>() {

        @Override
        public void onCompleted() {
        }

        @Override
        public void onError(Throwable e) {
            mITopNewsFragment.hidProgressDialog();
            mITopNewsFragment.showError(e.toString());
        }

        @Override
        public void onNext(NewsList newsList) {
            mITopNewsFragment.hidProgressDialog();
            mITopNewsFragment.upListItem(newsList);
        }
    });
    addSubscription(subscription);
}
Also used : NewsList(com.looklook.xinghongfei.looklook.bean.news.NewsList) Subscription(rx.Subscription)

Aggregations

NewsList (com.looklook.xinghongfei.looklook.bean.news.NewsList)1 Subscription (rx.Subscription)1