Search in sources :

Example 6 with NewPostImage

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());
}
Also used : NewPostImage(io.swagger.client.model.NewPostImage)

Example 7 with NewPostImage

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();
}
Also used : NewPostImage(io.swagger.client.model.NewPostImage)

Example 8 with NewPostImage

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);
}
Also used : NewPostImage(io.swagger.client.model.NewPostImage)

Aggregations

NewPostImage (io.swagger.client.model.NewPostImage)8 EditPost (io.swagger.client.model.EditPost)2 PostImage (io.swagger.client.model.PostImage)2 NewPost (io.swagger.client.model.NewPost)1