use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class AlbumSpinner method loadAlbums.
private void loadAlbums() {
AsyncRequest request = new AsyncRequest(Query.UPLOADABLE_ALBUM, KlyphSession.getSessionUserId(), "", new AsyncRequest.Callback() {
public void onComplete(Response response) {
onRequestComplete(response);
}
});
request.execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class AlbumSpinner method createAlbum.
@Override
public void createAlbum(final Album album, String privacy) {
Bundle bundle = new Bundle();
bundle.putString("name", album.getName());
bundle.putString("location", album.getLocation());
bundle.putString("message", album.getDescription());
bundle.putString("privacy", privacy);
final AlertDialog dialog = AlertUtil.showAlert(getActivity(), R.string.new_album, R.string.creating_album);
new AsyncRequest(Query.NEW_ALBUM, "", bundle, new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
dialog.dismiss();
if (response.getError() == null) {
Log.d("AlbumSpinner", "createAlbum id = " + response.getReturnedId());
album.setObject_id(response.getReturnedId());
((SpinnerAdapter) spinner.getAdapter()).add(album);
((SpinnerAdapter) spinner.getAdapter()).notifyDataSetChanged();
spinner.setSelection(spinner.getCount() - 1);
} else {
Toast.makeText(getActivity(), R.string.request_error, Toast.LENGTH_SHORT).show();
}
}
}).execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class KlyphFragment method refresh.
protected void refresh() {
startLoading();
if (KlyphFlags.LOG_REQUEST_EXEC)
Log.d(TAG, "request = " + requestType + ", id = " + elementId + ", offset = " + offset);
request = new AsyncRequest(requestType, elementId, offset, new AsyncRequest.Callback() {
public void onComplete(Response response) {
// Log.i(TAG, "onCompleted");
onRequestComplete(response);
}
});
request.execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class KlyphFragment2 method refresh.
protected void refresh() {
startLoading();
if (KlyphFlags.LOG_REQUEST_EXEC)
Log.d(TAG, "request = " + requestType + ", id = " + elementId + ", offset = " + offset);
request = new AsyncRequest(requestType, elementId, offset, new AsyncRequest.Callback() {
public void onComplete(Response response) {
Log.i(TAG, "onCompleted");
onRequestComplete(response);
}
});
request.execute();
}
use of com.abewy.android.apps.klyph.core.request.Response in project Klyph by jonathangerbaud.
the class ImageFragment method postComment.
private void postComment() {
if (sendTextEdit.getText().toString().length() > 0) {
Bundle params = new Bundle();
params.putString("message", sendTextEdit.getText().toString());
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(sendTextEdit.getWindowToken(), 0);
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, getElementId(), params, new AsyncRequest.Callback() {
@Override
public void onComplete(Response response) {
publishing.hide();
onCommentRequestComplete(response);
}
}).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