@@ -0,0 +1,1968 @@
+package com.testing.package;%0A%0Aimport android.support.annotation.LayoutRes;%0Aimport android.support.v4.app.Fragment;%0Aimport android.support.v7.widget.RecyclerView;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0A%0Aimport java.util.List;%0A%0A/**%0A * Created by @pablopantaleon on 11/7/15.%0A *%0A * Abstract base list adapter.%0A */%0Apublic abstract class BaseListAdapter%3CT, B extends BaseListAdapter.ListBaseViewHolder%3E extends RecyclerView.Adapter%3CB%3E  %7B%0A%0A    public List%3CT%3E items;%0A    public Fragment fragment;%0A%0A    private RecyclerViewListener mRecyclerViewListener;%0A%0A    public BaseListAdapter(Fragment fragment, List%3CT%3E items) %7B%0A        this.fragment = fragment;%0A        this.items = items;%0A%0A        if (fragment instanceof RecyclerViewListener) %7B%0A            this.mRecyclerViewListener = (RecyclerViewListener) fragment;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public B onCreateViewHolder(ViewGroup parent, int viewType) %7B%0A        return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutId(), parent, false));%0A    %7D%0A%0A    @Override%0A    public void onBindViewHolder(B holder, int position) %7B%0A        final T item = items.get(position);%0A%0A        holder.root.setOnClickListener(new View.OnClickListener() %7B%0A            @Override%0A            public void onClick(View v) %7B%0A                if (mRecyclerViewListener != null) %7B%0A                    mRecyclerViewListener.onItemClick(item);%0A                %7D%0A            %7D%0A        %7D);%0A    %7D%0A%0A    @Override%0A    public int getItemCount() %7B%0A        return items.size();%0A    %7D%0A%0A    public static class ListBaseViewHolder extends RecyclerView.ViewHolder %7B%0A        View root;%0A%0A        public ListBaseViewHolder(View view) %7B%0A            super(view);%0A            root = view;%0A        %7D%0A    %7D%0A%0A    public interface RecyclerViewListener%3CT%3E %7B%0A        void onItemClick(T item);%0A    %7D%0A%0A    public abstract @LayoutRes int getLayoutId();%0A%0A    public abstract B getViewHolder(View view);%0A%7D%0A

Add base list adapter