use of io.swagger.client.model.EditPost 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);
}
use of io.swagger.client.model.EditPost in project android-client by GenesisVision.
the class CreatePostPresenter method handleGetOriginalPostSuccess.
private void handleGetOriginalPostSuccess(EditablePost post) {
getOriginalPostSubscription.unsubscribe();
editPost = new EditPost();
editPost.setId(post.getId());
this.post.setImages(new ArrayList<>());
this.post.setText(post.getTextOriginal());
int i = 0;
for (PostImage image : post.getImages()) {
NewPostImage newPostImage = new NewPostImage();
newPostImage.setImage(image.getId());
newPostImage.setPosition(i);
this.post.getImages().add(newPostImage);
getViewState().createNewImageView();
getViewState().updateNewImageView(image.getId());
i++;
}
updatePublishButtonEnabled();
getViewState().setText(this.post.getText(), this.post.getText().length());
getViewState().showProgressBar(false);
}
Aggregations