Search in sources :

Example 1 with CommentBean

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

the class CommentPresenter method getCommentData.

@Override
public void getCommentData(int id, int commentKind) {
    if (commentKind == SHORT_COMMENT) {
        Subscription rxSubscription = mRetrofitHelper.fetchShortCommentInfo(id).compose(RxUtil.<CommentBean>rxSchedulerHelper()).subscribe(new CommonSubscriber<CommentBean>(mView) {

            @Override
            public void onNext(CommentBean commentBean) {
                mView.showContent(commentBean);
            }
        });
        addSubscrebe(rxSubscription);
    } else {
        Subscription rxSubscription = mRetrofitHelper.fetchLongCommentInfo(id).compose(RxUtil.<CommentBean>rxSchedulerHelper()).subscribe(new CommonSubscriber<CommentBean>(mView) {

            @Override
            public void onNext(CommentBean commentBean) {
                mView.showContent(commentBean);
            }
        });
        addSubscrebe(rxSubscription);
    }
}
Also used : Subscription(rx.Subscription) CommentBean(com.codeest.geeknews.model.bean.CommentBean)

Aggregations

CommentBean (com.codeest.geeknews.model.bean.CommentBean)1 Subscription (rx.Subscription)1