title: FirebaseUI 3.1.x RecyclerView.Adapter
body: <p>I am integrating a new piece of code and I need to update firebase-ui-database from 0.4.0 to 3.1.3 </p>
  
  <p>I am aware of <a href="https://stackoverflow.com/questions/47364513/why-i-cant-use-the-populateviewholder-override-method">Why I cant use the populateViewHolder override method?</a> </p>
  
  <p>but here I am using RecyclerView.Adapter and I do not have the documentation of 0.4.0 so I need an help to translate the below in 3.1.3 format.</p>
  
  <pre><code> private RecyclerView.Adapter&lt;CommentViewHolder&gt; mAdapter;
          final DatabaseReference commentsRef = FirebaseUtil.getCommentsRef().child(mPostRef);
          mAdapter = new FirebaseRecyclerAdapter&lt;Comment, CommentViewHolder&gt;(
                  Comment.class, R.layout.comment_item, CommentViewHolder.class, commentsRef) {
              @Override
              protected void populateViewHolder(final CommentViewHolder viewHolder,
                                                Comment comment, int position) {
                  Author author = comment.getAuthor();
                  //viewHolder.commentAuthor.setText(author.getFull_name());
                  //GlideUtil.loadProfileIcon(author.getProfile_picture(), viewHolder.commentPhoto);
  
                  viewHolder.authorRef = author.getUid();
                  viewHolder.commentTime
                          .setText(DateUtils.getRelativeTimeSpanString((long) comment.getTimestamp
                                  ()));
                  viewHolder.commentText.setText(comment.getText());
              }
          };
  </code></pre>
  
  <p>Any thoughts?</p>
  
  <p>EDITED: Below what I have done so far:</p>
  
  <pre><code>public class CommentsFragment extends Fragment {
      public static final String TAG = "CommentsFragment";
      // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
      private static final String POST_REF_PARAM = "post_ref_param";
      private static final int DEFAULT_MSG_LENGTH_LIMIT = 256;
      private EditText mEditText;
  
      public static class CommentViewHolder extends RecyclerView.ViewHolder {
          public final ImageView commentPhoto;
          public final TextView commentText;
          public final TextView commentAuthor;
          public final TextView commentTime;
          public String authorRef;
  
          public CommentViewHolder(View itemView) {
              super(itemView);
              commentPhoto = (ImageView) itemView.findViewById(R.id.comment_author_icon);
              commentText = (TextView) itemView.findViewById(R.id.comment_text);
              commentAuthor = (TextView) itemView.findViewById(R.id.comment_name);
              commentTime = (TextView) itemView.findViewById(R.id.comment_time);
              itemView.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      if (authorRef != null) {
                          Context context = v.getContext();
                          Intent userDetailIntent = new Intent(context, UserDetailActivity.class);
                          userDetailIntent.putExtra(UserDetailActivity.USER_ID_EXTRA_NAME,
                                  authorRef);
                          context.startActivity(userDetailIntent);
                      }
                  }
              });
          }
      }
  
      private FirebaseRecyclerAdapter&lt;Comment, CommentViewHolder&gt; mAdapter;
  &lt;CODE&gt;
          final DatabaseReference commentsRef = FirebaseUtil.getCommentsRef().child(mPostRef);
  
  
          SnapshotParser&lt;Comment&gt; parser = new SnapshotParser&lt;Comment&gt;() {
              @Override
              public Comment parseSnapshot(DataSnapshot dataSnapshot) {
                  Comment comment = dataSnapshot.getValue(Comment.class);
                  if (comment != null) {
                      comment.setId(dataSnapshot.getKey());
                  }
                  return comment;
              }
          };
  
          FirebaseRecyclerOptions&lt;Comment&gt; options =
                  new FirebaseRecyclerOptions.Builder&lt;Comment&gt;()
                          .setQuery(commentsRef, parser)
                          .build();
  
          mAdapter = new FirebaseRecyclerAdapter&lt;Comment, CommentViewHolder&gt;(options){
              @Override
              protected void populateViewHolder(final CommentViewHolder viewHolder, Comment comment, int position) {
                  Author author = comment.getAuthor();
                  //viewHolder.commentAuthor.setText(author.getFull_name());
                  //GlideUtil.loadProfileIcon(author.getProfile_picture(), viewHolder.commentPhoto);
  
                  viewHolder.authorRef = author.getUid();
                  viewHolder.commentTime
                          .setText(DateUtils.getRelativeTimeSpanString((long) comment.getTimestamp
                                  ()));
                  viewHolder.commentText.setText(comment.getText());
              }
  </code></pre>