// Path: app/src/main/java/com/timehop/droidcon2014retrofitsample/data/reddit/model/RedditComment.java
// public class RedditComment extends RedditSubmission {
//   RedditObject replies;
//   String subreddit_id;
//   String parent_id;
//   int controversiality;
//   String body;
//   String body_html;
//   String link_id;
//   int depth;
// 
//   public RedditObject getReplies() {
//     return replies;
//   }
// 
//   public String getSubredditId() {
//     return subreddit_id;
//   }
// 
//   public String getParentId() {
//     return parent_id;
//   }
// 
//   public int getControversiality() {
//     return controversiality;
//   }
// 
//   public String getBody() {
//     return body;
//   }
// 
//   public String getBodyHtml() {
//     return body_html;
//   }
// 
//   public String getLinkId() {
//     return link_id;
//   }
// 
//   public int getDepth() {
//     return depth;
//   }
// 
//   public void setDepth(int depth) {
//     this.depth = depth;
//   }
// }


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.timehop.droidcon2014retrofitsample.R;
import com.timehop.droidcon2014retrofitsample.data.reddit.model.RedditComment;
package com.timehop.droidcon2014retrofitsample.ui;



public class CommentsAdapter extends ArrayAdapter<RedditComment> {

  public CommentsAdapter(Context context) {
    super(context, 0);
  }

    private static class ViewHolder {

        private final TextView scoreTextView;
        private final TextView bodyTextView;

        private ViewHolder(final View view) {
            scoreTextView = (TextView) view.findViewById(R.id.score_textview);
            bodyTextView = (TextView) view.findViewById(R.id.body_textview);
        }
    }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      final RedditComment comment = getItem(position);
      final ViewHolder vh;
      if (convertView == null) {
          convertView = LayoutInflater.from(getContext())
                  .inflate(R.layout.view_comment, parent, false);
          vh = new ViewHolder(convertView);
          convertView.setTag(vh);
      } else {
          vh = (ViewHolder) convertView.getTag();
      }
      vh.scoreTextView.setText(String.valueOf(comment.getScore()));
      vh.bodyTextView.setText(comment.getBody());
// Path: app/src/main/java/com/timehop/droidcon2014retrofitsample/data/reddit/model/RedditComment.java
// public class RedditComment extends RedditSubmission {
//   RedditObject replies;
//   String subreddit_id;
//   String parent_id;
//   int controversiality;
//   String body;
//   String body_html;
//   String link_id;
//   int depth;
// 
//   public RedditObject getReplies() {
//     return replies;
//   }
// 
//   public String getSubredditId() {
//     return subreddit_id;
//   }
// 
//   public String getParentId() {
//     return parent_id;
//   }
// 
//   public int getControversiality() {
//     return controversiality;
//   }
// 
//   public String getBody() {
//     return body;
//   }
// 
//   public String getBodyHtml() {
//     return body_html;
//   }
// 
//   public String getLinkId() {
//     return link_id;
//   }
// 
//   public int getDepth() {
//     return depth;
//   }
// 
//   public void setDepth(int depth) {
//     this.depth = depth;
//   }
// }


// Path: app/src/main/java/com/timehop/droidcon2014retrofitsample/ui/CommentsAdapter.java
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import com.timehop.droidcon2014retrofitsample.R;
import com.timehop.droidcon2014retrofitsample.data.reddit.model.RedditComment;

package com.timehop.droidcon2014retrofitsample.ui;



public class CommentsAdapter extends ArrayAdapter<RedditComment> {

  public CommentsAdapter(Context context) {
    super(context, 0);
  }

    private static class ViewHolder {

        private final TextView scoreTextView;
        private final TextView bodyTextView;

        private ViewHolder(final View view) {
            scoreTextView = (TextView) view.findViewById(R.id.score_textview);
            bodyTextView = (TextView) view.findViewById(R.id.body_textview);
        }
    }

  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
      final RedditComment comment = getItem(position);
      final ViewHolder vh;
      if (convertView == null) {
          convertView = LayoutInflater.from(getContext())
                  .inflate(R.layout.view_comment, parent, false);
          vh = new ViewHolder(convertView);
          convertView.setTag(vh);
      } else {
          vh = (ViewHolder) convertView.getTag();
      }
      vh.scoreTextView.setText(String.valueOf(comment.getScore()));
      vh.bodyTextView.setText(comment.getBody());
      final int padding = getContext().getResources()