// Path: library/src/main/java/com/dreamliner/rvhelper/interfaces/OnItemClickListener.java
// public interface OnItemClickListener<T> {
//     void onItemClick(View v, int position, T t);
// }
// 
// Path: library/src/main/java/com/dreamliner/rvhelper/interfaces/OnItemLongClickListener.java
// public interface OnItemLongClickListener<T> {
//     boolean onItemLongClick(View v, int position, T t);
// }
// 
// Path: library/src/main/java/com/dreamliner/rvhelper/viewholder/BaseBindViewHolder.java
// public class BaseBindViewHolder<Binding extends ViewDataBinding, T> extends RecyclerView.ViewHolder implements View.OnClickListener,
//         View.OnLongClickListener {
// 
//     private final Binding mBinding;
// 
//     private T mItem;
//     private OnItemClickListener<T> mOnItemClickListener;
//     private OnItemLongClickListener<T> mOnItemLongClickListener;
// 
//     public BaseBindViewHolder(Binding binding) {
//         super(binding.getRoot());
//         mBinding = binding;
//     }
// 
//     public Binding getBinding() {
//         return mBinding;
//     }
// 
//     @Override
//     public void onClick(View v) {
//         if (null != mOnItemClickListener) {
//             int position = getAdapterPosition();
//             if (position != RecyclerView.NO_POSITION) {
//                 mOnItemClickListener.onItemClick(v, position, mItem);
//             }
//         }
//     }
// 
//     @Override
//     public boolean onLongClick(View v) {
//         if (null != mOnItemLongClickListener) {
//             int position = getAdapterPosition();
//             return position == RecyclerView.NO_POSITION || mOnItemLongClickListener.onItemLongClick(v, position, mItem);
//         }
//         return false;
//     }
// 
//     public void setItem(T item) {
//         mItem = item;
//     }
// 
//     public void setOnItemClickListener(OnItemClickListener<T> onItemClickListener) {
//         mOnItemClickListener = onItemClickListener;
//     }
// 
//     public void setOnItemLongClickListener(OnItemLongClickListener<T> onItemLongClickListener) {
//         mOnItemLongClickListener = onItemLongClickListener;
//     }
// }


import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.dreamliner.rvhelper.interfaces.OnItemClickListener;
import com.dreamliner.rvhelper.interfaces.OnItemLongClickListener;
import com.dreamliner.rvhelper.viewholder.BaseBindViewHolder;
import androidx.annotation.LayoutRes;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
package com.dreamliner.rvhelper.adapter;




/**
 * Created by chenzj on 2017/3/21.
 */

public class BaseDBAdapter<T> extends BaseDataDBAdapter<T> {

    protected int mLayoutRes;

    public BaseDBAdapter(@LayoutRes int layoutRes) {
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemClickListener<T> onItemClickListener, @LayoutRes int layoutRes) {
        super(onItemClickListener);
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemLongClickListener<T> onItemLongClickListener, @LayoutRes int layoutRes) {
        super(onItemLongClickListener);
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemClickListener<T> onItemClickListener, OnItemLongClickListener<T> onItemLongClickListener,
                         @LayoutRes int layoutRes) {
        super(onItemClickListener, onItemLongClickListener);
        mLayoutRes = layoutRes;
    }

    @Override
// Path: library/src/main/java/com/dreamliner/rvhelper/interfaces/OnItemClickListener.java
// public interface OnItemClickListener<T> {
//     void onItemClick(View v, int position, T t);
// }
// 
// Path: library/src/main/java/com/dreamliner/rvhelper/interfaces/OnItemLongClickListener.java
// public interface OnItemLongClickListener<T> {
//     boolean onItemLongClick(View v, int position, T t);
// }
// 
// Path: library/src/main/java/com/dreamliner/rvhelper/viewholder/BaseBindViewHolder.java
// public class BaseBindViewHolder<Binding extends ViewDataBinding, T> extends RecyclerView.ViewHolder implements View.OnClickListener,
//         View.OnLongClickListener {
// 
//     private final Binding mBinding;
// 
//     private T mItem;
//     private OnItemClickListener<T> mOnItemClickListener;
//     private OnItemLongClickListener<T> mOnItemLongClickListener;
// 
//     public BaseBindViewHolder(Binding binding) {
//         super(binding.getRoot());
//         mBinding = binding;
//     }
// 
//     public Binding getBinding() {
//         return mBinding;
//     }
// 
//     @Override
//     public void onClick(View v) {
//         if (null != mOnItemClickListener) {
//             int position = getAdapterPosition();
//             if (position != RecyclerView.NO_POSITION) {
//                 mOnItemClickListener.onItemClick(v, position, mItem);
//             }
//         }
//     }
// 
//     @Override
//     public boolean onLongClick(View v) {
//         if (null != mOnItemLongClickListener) {
//             int position = getAdapterPosition();
//             return position == RecyclerView.NO_POSITION || mOnItemLongClickListener.onItemLongClick(v, position, mItem);
//         }
//         return false;
//     }
// 
//     public void setItem(T item) {
//         mItem = item;
//     }
// 
//     public void setOnItemClickListener(OnItemClickListener<T> onItemClickListener) {
//         mOnItemClickListener = onItemClickListener;
//     }
// 
//     public void setOnItemLongClickListener(OnItemLongClickListener<T> onItemLongClickListener) {
//         mOnItemLongClickListener = onItemLongClickListener;
//     }
// }


// Path: library/src/main/java/com/dreamliner/rvhelper/adapter/BaseDBAdapter.java
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.dreamliner.rvhelper.interfaces.OnItemClickListener;
import com.dreamliner.rvhelper.interfaces.OnItemLongClickListener;
import com.dreamliner.rvhelper.viewholder.BaseBindViewHolder;
import androidx.annotation.LayoutRes;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

package com.dreamliner.rvhelper.adapter;




/**
 * Created by chenzj on 2017/3/21.
 */

public class BaseDBAdapter<T> extends BaseDataDBAdapter<T> {

    protected int mLayoutRes;

    public BaseDBAdapter(@LayoutRes int layoutRes) {
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemClickListener<T> onItemClickListener, @LayoutRes int layoutRes) {
        super(onItemClickListener);
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemLongClickListener<T> onItemLongClickListener, @LayoutRes int layoutRes) {
        super(onItemLongClickListener);
        mLayoutRes = layoutRes;
    }

    public BaseDBAdapter(OnItemClickListener<T> onItemClickListener, OnItemLongClickListener<T> onItemLongClickListener,
                         @LayoutRes int layoutRes) {
        super(onItemClickListener, onItemLongClickListener);
        mLayoutRes = layoutRes;
    }

    @Override
    public BaseBindViewHolder createCustomViewHolder(ViewGroup parent, int viewType) {