Search in sources :

Example 1 with GetTopicListTask

use of org.mazhuang.guanggoo.data.task.GetTopicListTask in project guanggoo-android by mzlogin.

the class TopicListPresenter method getMoreTopic.

@Override
public void getMoreTopic(int page) {
    if (mCurrentTask != null) {
        mCurrentTask.cancel();
    }
    mCurrentTask = new GetTopicListTask(UrlUtil.appendPage(mView.getUrl(), page), new OnResponseListener<TopicList>() {

        @Override
        public void onSucceed(TopicList data) {
            mView.onGetMoreTopicSucceed(data);
            mCurrentTask = null;
        }

        @Override
        public void onFailed(String msg) {
            mView.onGetMoreTopicFailed(msg);
            mCurrentTask = null;
        }
    });
    NetworkTaskScheduler.getInstance().execute(mCurrentTask);
}
Also used : GetTopicListTask(org.mazhuang.guanggoo.data.task.GetTopicListTask) OnResponseListener(org.mazhuang.guanggoo.data.OnResponseListener) TopicList(org.mazhuang.guanggoo.data.entity.TopicList)

Example 2 with GetTopicListTask

use of org.mazhuang.guanggoo.data.task.GetTopicListTask in project guanggoo-android by mzlogin.

the class TopicListPresenter method getTopicList.

@Override
public void getTopicList() {
    if (mCurrentTask != null) {
        mCurrentTask.cancel();
    }
    mCurrentTask = new GetTopicListTask(mView.getUrl(), new OnResponseListener<TopicList>() {

        @Override
        public void onSucceed(TopicList data) {
            mView.onGetTopicListSucceed(data);
            mCurrentTask = null;
        }

        @Override
        public void onFailed(String msg) {
            mView.onGetTopicListFailed(msg);
            mCurrentTask = null;
        }
    });
    NetworkTaskScheduler.getInstance().execute(mCurrentTask);
}
Also used : GetTopicListTask(org.mazhuang.guanggoo.data.task.GetTopicListTask) OnResponseListener(org.mazhuang.guanggoo.data.OnResponseListener) TopicList(org.mazhuang.guanggoo.data.entity.TopicList)

Aggregations

OnResponseListener (org.mazhuang.guanggoo.data.OnResponseListener)2 TopicList (org.mazhuang.guanggoo.data.entity.TopicList)2 GetTopicListTask (org.mazhuang.guanggoo.data.task.GetTopicListTask)2