use of vision.genesis.clientapp.ui.SocialCommentView in project android-client by GenesisVision.
the class PostDetailsActivity method updateView.
@Override
public void updateView(Post post) {
postView.setPost(post);
if (post.getComments() != null && !post.getComments().isEmpty()) {
this.commentsSection.setVisibility(View.VISIBLE);
this.comments.setText(String.format(Locale.getDefault(), "%d %s", post.getComments().size(), GenesisVisionApplication.INSTANCE.getResources().getQuantityString(R.plurals.comments, post.getComments().size())));
this.commentsGroup.removeAllViews();
for (Post comment : post.getComments()) {
SocialCommentView view = new SocialCommentView(this);
view.setCanCommentPost(post.getPersonalDetails() != null && post.getPersonalDetails().isCanComment());
view.setComment(comment);
view.setListener(presenter);
commentsGroup.addView(view);
}
} else {
this.commentsSection.setVisibility(View.GONE);
}
if (post.getPersonalDetails() != null && post.getPersonalDetails().isCanComment()) {
this.addCommentGroup.setVisibility(View.VISIBLE);
} else {
this.addCommentGroup.setVisibility(View.GONE);
}
}
Aggregations