use of com.abewy.android.apps.klyph.request.AsyncRequest in project Klyph by jonathangerbaud.
the class ImageFragment method deleteComment.
private void deleteComment(final Comment comment) {
final AlertDialog dialog = AlertUtil.showAlert(getActivity(), R.string.delete, R.string.deleting);
new AsyncRequest(Query.DELETE_POST, comment.getId(), "", new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
dialog.dismiss();
onDeleteCommentRequestComplete(response, comment);
}
}).execute();
}
use of com.abewy.android.apps.klyph.request.AsyncRequest in project Klyph by jonathangerbaud.
the class ImageFragment method handleSendReplyAction.
private void handleSendReplyAction(final Comment comment, String reply) {
if (reply.length() > 0) {
Bundle params = new Bundle();
params.putString("message", reply);
final AlertDialog publishing = new AlertDialog.Builder(getActivity()).setTitle(R.string.publish_comment_dialog_title).setMessage(R.string.publish_comment_dialog_message).setCancelable(false).create();
publishing.show();
new AsyncRequest(Query.POST_COMMENT, comment.getId(), params, new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
publishing.hide();
onReplyCommentRequestComplete(response, comment);
}
}).execute();
} else {
new AlertDialog.Builder(getActivity()).setTitle(R.string.error).setMessage(R.string.define_comment_before_publish).setPositiveButton(R.string.ok, null).create().show();
}
}
Aggregations