Search in sources :

Example 1 with FavouriteTask

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

the class TopicDetailPresenter method favorite.

@Override
public void favorite() {
    String topicId = UrlUtil.getTid(getUrl());
    String favouriteUrl = ConstantUtil.FAVORITE_URL + "?topic_id=" + topicId;
    NetworkTaskScheduler.getInstance().execute(new FavouriteTask(favouriteUrl, new OnResponseListener<String>() {

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

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

Example 2 with FavouriteTask

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

the class TopicDetailPresenter method unfavorite.

@Override
public void unfavorite() {
    String topicId = UrlUtil.getTid(getUrl());
    String favouriteUrl = ConstantUtil.UN_FAVORITE_URL + "?topic_id=" + topicId;
    NetworkTaskScheduler.getInstance().execute(new FavouriteTask(favouriteUrl, new OnResponseListener<String>() {

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

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

Aggregations

OnResponseListener (org.mazhuang.guanggoo.data.OnResponseListener)2 FavouriteTask (org.mazhuang.guanggoo.data.task.FavouriteTask)2