use of in.ac.iitb.gymkhana.iitbapp.api.model.ImageUploadRequest in project IITB-App by wncc.
the class AddEventFragment method sendImage.
private void sendImage() {
progressDialog.setMessage("Uploading Image");
ImageUploadRequest imageUploadRequest = new ImageUploadRequest(base64Image);
RetrofitInterface retrofitInterface = ServiceGenerator.createService(RetrofitInterface.class);
retrofitInterface.uploadImage("sessionid=" + getArguments().getString(SESSION_ID), imageUploadRequest).enqueue(new Callback<ImageUploadResponse>() {
@Override
public void onResponse(Call<ImageUploadResponse> call, Response<ImageUploadResponse> response) {
if (response.isSuccessful()) {
ImageUploadResponse imageUploadResponse = response.body();
String imageURL = imageUploadResponse.getPictureURL();
addEvent(imageURL);
}
}
@Override
public void onFailure(Call<ImageUploadResponse> call, Throwable t) {
progressDialog.dismiss();
}
});
}
Aggregations