Search in sources :

Example 11 with OnResponseListener

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

the class TopicDetailPresenter method getTopicDetail.

@Override
public void getTopicDetail() {
    mView.startLoading();
    NetworkTaskScheduler.getInstance().execute(new GetTopicDetailTask(getUrl(), new OnResponseListener<TopicDetail>() {

        @Override
        public void onSucceed(TopicDetail data) {
            mView.stopLoading();
            mView.onGetTopicDetailSucceed(data);
        }

        @Override
        public void onFailed(String msg) {
            mView.stopLoading();
            mView.onGetTopicDetailFailed(msg);
        }
    }));
}
Also used : OnResponseListener(org.mazhuang.guanggoo.data.OnResponseListener) GetTopicDetailTask(org.mazhuang.guanggoo.data.task.GetTopicDetailTask) TopicDetail(org.mazhuang.guanggoo.data.entity.TopicDetail)

Example 12 with OnResponseListener

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

the class LoginPresenter method login.

@Override
public void login(String email, String password) {
    mView.startLoading();
    NetworkTaskScheduler.getInstance().execute(new LoginTask(email, password, new OnResponseListener<String>() {

        @Override
        public void onSucceed(String data) {
            mView.stopLoading();
            mView.onLoginSucceed(data);
        }

        @Override
        public void onFailed(String msg) {
            mView.stopLoading();
            mView.onLoginFailed(msg);
        }
    }));
}
Also used : OnResponseListener(org.mazhuang.guanggoo.data.OnResponseListener) LoginTask(org.mazhuang.guanggoo.data.task.LoginTask)

Aggregations

OnResponseListener (org.mazhuang.guanggoo.data.OnResponseListener)12 TopicList (org.mazhuang.guanggoo.data.entity.TopicList)2 FavouriteTask (org.mazhuang.guanggoo.data.task.FavouriteTask)2 GetTopicListTask (org.mazhuang.guanggoo.data.task.GetTopicListTask)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1 Connection (org.jsoup.Connection)1 NodeCategory (org.mazhuang.guanggoo.data.entity.NodeCategory)1 TopicDetail (org.mazhuang.guanggoo.data.entity.TopicDetail)1 UserProfile (org.mazhuang.guanggoo.data.entity.UserProfile)1 AuthCheckTask (org.mazhuang.guanggoo.data.task.AuthCheckTask)1 CommentTask (org.mazhuang.guanggoo.data.task.CommentTask)1 GetNodesCloudTask (org.mazhuang.guanggoo.data.task.GetNodesCloudTask)1 GetTopicDetailTask (org.mazhuang.guanggoo.data.task.GetTopicDetailTask)1 GetUserProfileTask (org.mazhuang.guanggoo.data.task.GetUserProfileTask)1 LoginTask (org.mazhuang.guanggoo.data.task.LoginTask)1 NewTopicTask (org.mazhuang.guanggoo.data.task.NewTopicTask)1