use of com.abewy.android.apps.klyph.core.request.Response 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();
}
}
use of com.abewy.android.apps.klyph.core.request.Response 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.core.request.Response in project Klyph by jonathangerbaud.
the class StreamFragment 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.core.request.Response in project Klyph by jonathangerbaud.
the class ImageActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
// requestWindowFeature(Window.FEATURE_NO_TITLE);
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
// Let the Application class know that the first launch is complete
// If we come from a notification, then do not show the ads
// When going back to main activity
KlyphApplication.getInstance().launchComplete();
isDestroyed = false;
getWindow().setBackgroundDrawableResource(R.drawable.image_background);
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background_transparent_gradient));
setTitle("");
final ImageFragment image = (ImageFragment) getFragmentManager().findFragmentById(R.id.image_fragment);
String photoId = getIntent().getStringExtra(KlyphBundleExtras.PHOTO_ID);
Log.d("ImageActivity", "photo id " + photoId);
String userId = getIntent().getStringExtra(KlyphBundleExtras.USER_ID);
if (photoId != null) {
image.setElementId(photoId);
// image.load();
} else if (userId != null) {
AsyncRequest loadRequest = new AsyncRequest(Query.USER_PROFILE_PHOTO, userId, "", new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
if (response.getError() == null) {
if (response.getGraphObjectList().size() > 0 && isDestroyed == false) {
Photo photo = (Photo) response.getGraphObjectList().get(0);
image.setElementId(photo.getObject_id());
image.load();
}
}
}
});
loadRequest.execute();
}
}
Aggregations