package com.example.andremion.designsupportlibrary;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import java.util.List;

public class ListAdapter extends RecyclerView.Adapter<ListAdapter.ViewHolder> {

    private final List<String> mItems;
    private OnItemClickListener mItemClickListener;

    public ListAdapter(List<String> items) {
        mItems = items;
    }

    public void setOnItemClickListener(OnItemClickListener l) {
        mItemClickListener = l;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(parent.getContext())
                .inflate(android.R.layout.simple_list_item_1, parent, false);
        return new ViewHolder(v);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, final int position) {
        holder.mTextView.setText(mItems.get(position));
        holder.mTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (mItemClickListener != null) {
                    mItemClickListener.onItemClick(v, position);
                }
            }
        });
    }

    @Override
    public int getItemCount() {
        return mItems.size();
    }

    public interface OnItemClickListener {
        void onItemClick(View view, int position);
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {

        private final TextView mTextView;

        private ViewHolder(View v) {
            super(v);
            mTextView = (TextView) v.findViewById(android.R.id.text1);
        }
    }
}

@@ -320,16 +320,48 @@
 wHolder%3E
+ implements View.OnClickListener
  %7B%0A%0A    
@@ -852,16 +852,52 @@
 false);%0A
+        v.setOnClickListener(this);%0A
         
@@ -1013,24 +1013,67 @@
 position) %7B%0A
+        holder.mItemView.setTag(position);%0A
         hold
@@ -1124,85 +1124,94 @@
     
+%7D%0A%0A
     
-holder.mTextView.setOnClickListener(new View.OnClickListener() %7B%0A        
+@Override%0A    public int getItemCount() %7B%0A        return mItems.size();%0A    %7D%0A%0A
     
@@ -1220,24 +1220,16 @@
 verride%0A
-        
     publ
@@ -1262,24 +1262,16 @@
         
-    
-    
 if (mIte
@@ -1308,24 +1308,16 @@
         
-    
-    
 mItemCli
@@ -1346,145 +1346,40 @@
 (v, 
-position);%0A                %7D%0A            %7D%0A        %7D);%0A    %7D%0A%0A    @Override%0A    public int getItemCount() %7B%0A        return mItems.size();
+(Integer) v.getTag());%0A        %7D
 %0A   
@@ -1549,24 +1549,62 @@
 ewHolder %7B%0A%0A
+        private final View mItemView;%0A
         priv
@@ -1689,24 +1689,51 @@
   super(v);%0A
+            mItemView = v;%0A
             

Refactor on item click listener