Search in sources :

Example 1 with SocialCommentView

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);
    }
}
Also used : SocialCommentView(vision.genesis.clientapp.ui.SocialCommentView) EditablePost(io.swagger.client.model.EditablePost) Post(io.swagger.client.model.Post)

Aggregations

EditablePost (io.swagger.client.model.EditablePost)1 Post (io.swagger.client.model.Post)1 SocialCommentView (vision.genesis.clientapp.ui.SocialCommentView)1