Search in sources :

Example 1 with NewPost

use of io.swagger.client.model.NewPost in project android-client by GenesisVision.

the class PostDetailsPresenter method clearAddCommentSection.

private void clearAddCommentSection() {
    this.newComment = new NewPost();
    this.newComment.setImages(new ArrayList<>());
    this.replyComment = null;
    getViewState().clearAddCommentSection();
    getViewState().hideReplyGroup();
    updateSendCommentButtonEnabled();
    updateImageCommentButtonEnabled();
}
Also used : NewPost(io.swagger.client.model.NewPost)

Example 2 with NewPost

use of io.swagger.client.model.NewPost in project android-client by GenesisVision.

the class PostDetailsPresenter method handleGetOriginalCommentSuccess.

private void handleGetOriginalCommentSuccess(EditablePost comment) {
    getOriginalCommentSubscription.unsubscribe();
    editComment = new EditPost();
    editComment.setId(comment.getId());
    newComment = new NewPost();
    newComment.setImages(new ArrayList<>());
    newComment.setText(comment.getTextOriginal());
    int i = 0;
    for (PostImage image : comment.getImages()) {
        NewPostImage newPostImage = new NewPostImage();
        newPostImage.setImage(image.getId());
        newPostImage.setPosition(i);
        newComment.getImages().add(newPostImage);
        getViewState().createNewImageView();
        getViewState().updateNewImageView(image.getId());
        i++;
    }
    updateImageCommentButtonEnabled();
    updateSendCommentButtonEnabled();
    getViewState().showEditComment(comment);
}
Also used : PostImage(io.swagger.client.model.PostImage) NewPostImage(io.swagger.client.model.NewPostImage) NewPostImage(io.swagger.client.model.NewPostImage) NewPost(io.swagger.client.model.NewPost) EditPost(io.swagger.client.model.EditPost)

Aggregations

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