use of io.swagger.client.model.NewPostImage in project android-client by GenesisVision.
the class CreatePostPresenter method onPostImageClicked.
@Override
public void onPostImageClicked(ImageView image, String imageId) {
int position = 0;
for (NewPostImage postImage : post.getImages()) {
if (postImage.getImage().equals(imageId)) {
break;
}
position++;
}
getViewState().showImageViewer(image, position, post.getImages());
}
use of io.swagger.client.model.NewPostImage in project android-client by GenesisVision.
the class PostDetailsPresenter method onDeleteImageClicked.
@Override
public void onDeleteImageClicked(NewPostImageView imageView, String imageId) {
for (NewPostImage postImage : newComment.getImages()) {
if (postImage.getImage().equals(imageId)) {
newComment.getImages().remove(postImage);
break;
}
}
getViewState().deleteImageView(imageView);
updateSendCommentButtonEnabled();
updateImageCommentButtonEnabled();
}
use of io.swagger.client.model.NewPostImage in project android-client by GenesisVision.
the class PostDetailsPresenter method handleUploadImageResponse.
private void handleUploadImageResponse(UploadResult response) {
uploadImageSubscription.unsubscribe();
getViewState().updateNewImageView(response.getId().toString());
updateSendCommentButtonEnabled();
NewPostImage newPostImage = new NewPostImage();
newPostImage.setImage(response.getId().toString());
newPostImage.setPosition(newComment.getImages().size());
newComment.getImages().add(newPostImage);
updateImageCommentButtonEnabled();
ImageUtils.deleteTempFile(newImageFile);
}
Aggregations