Advertisement
rachmadi

CommentViewHolder

Mar 13th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1.  
  2. import android.support.v7.widget.RecyclerView;
  3. import android.view.View;
  4. import android.widget.TextView;
  5.  
  6. /**
  7.  * Created by rachmadi on 10/12/16.
  8.  */
  9.  
  10. public class CommentViewHolder extends RecyclerView.ViewHolder {
  11.  
  12.     TextView tvContent, tvFullName, tvTime;
  13.  
  14.     public CommentViewHolder(View itemView) {
  15.         super(itemView);
  16.  
  17.         tvFullName = (TextView) itemView.findViewById(R.id.tvFullName);
  18.         tvContent = (TextView) itemView.findViewById(R.id.tvContent);
  19.         tvTime = (TextView) itemView.findViewById(R.id.tvTime);
  20.     }
  21.  
  22.     public void bindToComment(Comment comment){
  23.  
  24.         tvFullName.setText(comment.getFullName());
  25.         tvContent.setText(comment.getCommentContent());
  26.         System.out.println("bindToComment: " + comment.getCommentContent() + ", " + comment.getFullName());
  27.  
  28.         Utilities util = new Utilities();
  29.         String time = util.getPostTime(comment.timestamp);
  30.         tvTime.setText(time);
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement