use of org.mazhuang.guanggoo.data.OnResponseListener in project guanggoo-android by mzlogin.
the class SplashActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NetworkTaskScheduler.getInstance().execute(new AuthCheckTask(new OnResponseListener<String>() {
@Override
public void onSucceed(String data) {
startHome();
}
@Override
public void onFailed(String msg) {
startHome();
}
}));
}
use of org.mazhuang.guanggoo.data.OnResponseListener in project guanggoo-android by mzlogin.
the class NewTopicPresenter method newTopic.
@Override
public void newTopic(String title, String content) {
mView.startLoading();
title = EmojiParser.parseToAliases(title);
content = EmojiParser.parseToAliases(content);
NetworkTaskScheduler.getInstance().execute(new NewTopicTask(mView.getUrl(), title, content, new OnResponseListener<String>() {
@Override
public void onSucceed(String data) {
mView.stopLoading();
mView.onNewTopicSucceed();
}
@Override
public void onFailed(String msg) {
mView.stopLoading();
mView.onNewTopicFailed(msg);
}
}));
}
use of org.mazhuang.guanggoo.data.OnResponseListener in project guanggoo-android by mzlogin.
the class NodesCloudPresenter method getNodesCloud.
@Override
public void getNodesCloud() {
mView.startLoading();
NetworkTaskScheduler.getInstance().execute(new GetNodesCloudTask(new OnResponseListener<List<NodeCategory>>() {
@Override
public void onSucceed(List<NodeCategory> data) {
mView.stopLoading();
mView.onGetNodesCloudSucceed(data);
}
@Override
public void onFailed(String msg) {
mView.stopLoading();
mView.onGetNodesCloudFailed(msg);
}
}));
}
use of org.mazhuang.guanggoo.data.OnResponseListener 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);
}
use of org.mazhuang.guanggoo.data.OnResponseListener in project guanggoo-android by mzlogin.
the class UserProfilePresenter method getUserProfile.
@Override
public void getUserProfile(String url) {
mView.startLoading();
NetworkTaskScheduler.getInstance().execute(new GetUserProfileTask(url, new OnResponseListener<UserProfile>() {
@Override
public void onSucceed(UserProfile data) {
mView.stopLoading();
mView.onGetUserProfileSucceed(data);
}
@Override
public void onFailed(String msg) {
mView.stopLoading();
mView.onGetUserProfileFailed(msg);
}
}));
}
Aggregations