package jp.satorufujiwara.binder.recycler;


import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import jp.satorufujiwara.binder.Binder;
import jp.satorufujiwara.binder.ViewType;

public abstract class RecyclerBinder<V extends ViewType>
        implements Binder<V, RecyclerView.ViewHolder> {

    private final V mViewType;
    private Context mContext;

    protected RecyclerBinder(final Context context, final V viewType) {
        mContext = context;
        mViewType = viewType;
    }

    @LayoutRes
    public abstract int layoutResId();

    public abstract RecyclerView.ViewHolder onCreateViewHolder(final View v);

    @Override
    public final RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent) {
        return onCreateViewHolder(View.inflate(mContext, layoutResId(), null));
    }

    @Override
    public void onViewRecycled(RecyclerView.ViewHolder holder) {
        // no op
    }

    @Override
    public void onRemoved() {
        mContext = null;
    }

    @Override
    public V getViewType() {
        return mViewType;
    }

    public final Context getContext() {
        return mContext;
    }

}

@@ -158,24 +158,60 @@
 cyclerView;%0A
+import android.view.LayoutInflater;%0A
 import andro
@@ -924,31 +924,46 @@
 der(
-View.inflate(mContext, 
+LayoutInflater.from(mContext).inflate(
 layo
@@ -973,20 +973,29 @@
 esId(), 
-null
+parent, false
 ));%0A    

Fix inflated view using parent view.