content: package com.jwenfeng.pulltorefresh.adapter;
  
  import android.support.v7.widget.RecyclerView;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  
  import com.jwenfeng.pulltorefresh.R;
  
  import java.util.List;
  
  /**
   * 当前类注释:
   * 作者：jinwenfeng on 2016/12/10 13:55
   * 邮箱：823546371@qq.com
   * QQ： 823546371
   * 公司：南京穆尊信息科技有限公司
   * © 2016 jinwenfeng
   * © 版权所有，未经允许不得传播
   */
  public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.RecyclerViewHolder> {
  
      private List<String> list;
  
      public RecyclerViewAdapter(List<String> list) {
          this.list = list;
      }
  
      @Override
      public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_item,null);
          return new RecyclerViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(RecyclerViewHolder holder, int position) {
          holder.tv.setText(list.get(position));
      }
  
      @Override
      public int getItemCount() {
          return list.size();
      }
  
      class RecyclerViewHolder extends RecyclerView.ViewHolder{
  
          private TextView tv;
  
          public RecyclerViewHolder(View itemView) {
              super(itemView);
              tv = (TextView) itemView.findViewById(R.id.item_tv);
          }
      }
  
  }
  