public class DBMultypeSingleItemActivity extends AppCompatActivity {
    private ActivityDbBinding mBinding;

    private BaseMulTypeBindingAdapter mAdapter;
    private List<MulTypeSingleBean> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = ActivityDbBinding.inflate(getLayoutInflater());
        setContentView(mBinding.getRoot());

        mDatas = initDatas();
        mAdapter = new BaseMulTypeBindingAdapter<MulTypeSingleBean>(this, mDatas) {
            @Override
            public void onBindViewHolder(BaseBindingVH<ViewDataBinding> holder, int position) {
                super.onBindViewHolder(holder, position);
                //如果有特殊需求，可传入数据结构的泛型，避免强转
                MulTypeSingleBean data = mDatas.get(position);
                //Binding类 不可避免的需要强转了
                ViewDataBinding binding = holder.getBinding();
                switch (data.getItemLayoutId()) {
                    case R.layout.item_db_mul_1:
                        ItemDbMul1Binding itemDbMul1Binding = (ItemDbMul1Binding) binding;
                        break;
                    case R.layout.item_db_mul_2:
                        ItemDbMul2Binding itemDbMul2Binding = (ItemDbMul2Binding) binding;
                        break;
                }

            }
        };

        //设置点击事件
        mAdapter.setItemPresenter(new SingleBeanPresenter());

        mBinding.rv.setAdapter(mAdapter);
        mBinding.rv.setLayoutManager(new LinearLayoutManager(this));

    }

    /**
     * ★ Item点击事件P
     */
    public class SingleBeanPresenter {
        public void onTvClick(String string) {
            Toast.makeText(DBMultypeSingleItemActivity.this, "第一种类型的TextView点击了:" + string, Toast.LENGTH_SHORT).show();
        }

        public void onTvClick2(MulTypeSingleBean mulTypeSingleBean) {
            Toast.makeText(DBMultypeSingleItemActivity.this, "第2种类型的TextView点击了 改变之前:" + mulTypeSingleBean.getName(), Toast.LENGTH_SHORT).show();
            mulTypeSingleBean.setName("改变之后");
        }
    }


    public List<MulTypeSingleBean> initDatas() {
        List<MulTypeSingleBean> datas = new ArrayList<>();
        datas.add(new MulTypeSingleBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type").setReceive(true));
        datas.add(new MulTypeSingleBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));
        datas.add(new MulTypeSingleBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童").setReceive(true));
        datas.add(new MulTypeSingleBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new MulTypeSingleBean("http://www.kejik.com/image/1460343965520.jpg", "多种type").setReceive(true));
        datas.add(new MulTypeSingleBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));
        datas.add(new MulTypeSingleBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new MulTypeSingleBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class DBMulTypeMulBeanActivity extends AppCompatActivity {
    private ActivityDbBinding mBinding;

    private BaseMulTypeBindingAdapter mAdapter;
    private List mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = ActivityDbBinding.inflate(getLayoutInflater());
        setContentView(mBinding.getRoot());

        mDatas = initDatas();

        mAdapter = new BaseMulTypeBindingAdapter(this, mDatas) {
            @Override
            public void onBindViewHolder(BaseBindingVH holder, int position) {
                super.onBindViewHolder(holder, position);
                //如果有特殊需求 重写onBindViewHolder方法
                // 数据结构 和 Binding类 都不可避免的需要强转了
                ViewDataBinding binding = holder.getBinding();
                switch (getItemViewType(position)) {
                    case R.layout.item_db_mul_1:
                        ItemDbMul1Binding itemDbMul1Binding = (ItemDbMul1Binding) binding;
                        MulTypeMulBean1 data1 = (MulTypeMulBean1) mDatas.get(position);
                        break;
                    case R.layout.item_db_mul_2:
                        ItemDbMul2Binding itemDbMul2Binding = (ItemDbMul2Binding) binding;
                        MulTypeMulBean2 data2 = (MulTypeMulBean2) mDatas.get(position);
                        break;
                }
            }
        };

        //设置点击事件：
        mAdapter.setItemPresenter(new MulTypeMulBeanPresenter());

        mBinding.rv.setLayoutManager(new LinearLayoutManager(this));
        mBinding.rv.setAdapter(mAdapter);
    }

    /**
     * ★ Item点击事件P
     */
    public class MulTypeMulBeanPresenter {
        public void onTvClick(String string) {
            Toast.makeText(DBMulTypeMulBeanActivity.this, "第一种类型的TextView点击了:" + string, Toast.LENGTH_SHORT).show();
        }

        public void onImageClick2(MulTypeMulBean2 data) {
            data.setBackground("http://image101.360doc.com/DownloadImg/2016/10/2813/83246025_16.jpg");
        }
    }

    public List initDatas() {
        List datas = new ArrayList<>();
        datas.add(new MulTypeMulBean2("http://desk.fd.zol-img.com.cn/t_s960x600c5/g5/M00/01/0E/ChMkJlbKwaOIN8zJAAs5DadIS-IAALGbQPo5ngACzkl365.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));

        datas.add(new MulTypeMulBean2("http://cdn.duitang.com/uploads/item/201610/20/20161020070310_c5xWi.jpeg"));

        datas.add(new MulTypeMulBean1("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new MulTypeMulBean1("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));

        datas.add(new MulTypeMulBean2("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1512/31/c4/17105160_1451572371249_800x800.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class DBSingleActivity extends AppCompatActivity {
    private ActivityDbBinding mBinding;
    private BaseBindingAdapter mAdapter;
    private List<DBSingleBean> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_db);
        mBinding = ActivityDbBinding.inflate(getLayoutInflater());
        setContentView(mBinding.getRoot());
        mDatas = initDatas();
        mBinding.setClickPresenter(new ClickPresenter());
        mBinding.rv.setLayoutManager(new LinearLayoutManager(this));


        // ★泛型D:是Bean类型，如果有就传。  泛型B:是对应的xml Layout的Binding类
        mAdapter = new BaseBindingAdapter<DBSingleBean, ItemDbSingleBinding>(this, mDatas, R.layout.item_db_single) {
            @Override
            public void onBindViewHolder(BaseBindingVH<ItemDbSingleBinding> holder, int position) {
                //★super一定不要删除
                super.onBindViewHolder(holder, position);
                //如果有特殊需求，可传入两个泛型，重写onBindViewHolder搞事情。
                ItemDbSingleBinding binding = holder.getBinding();
                DBSingleBean data = mDatas.get(position);
                holder.getBinding().setPosition(holder.getLayoutPosition());
            }
        };

        //★ 设置Item点击事件
        mAdapter.setItemPresenter(new SingleItemPresenter());
        mBinding.rv.setAdapter(mAdapter);

    }

    /**
     * ★ Item点击事件P
     */
    public class SingleItemPresenter {
        public void onItemClick(DBSingleBean data, int position) {
            data.setName("修改之后立刻见效");
            Toast.makeText(DBSingleActivity.this, "postion:" + position, Toast.LENGTH_SHORT).show();
        }
    }


    public class ClickPresenter {
        public void onAddClick(View v) {
            mAdapter.add(1, new DBSingleBean("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1304/25/c1/20230636_1366863045911_800x800.jpg", "add"));
        }

        public void onDelClick(View v) {
            mAdapter.remove(1);
        }

        public void onAddClick2(View v) {
            mAdapter.add(new DBSingleBean("http://image57.360doc.com/DownloadImg/2012/12/1111/28833848_3.jpg", "add末尾"));
        }

    }

    public List<DBSingleBean> initDatas() {
        List<DBSingleBean> datas = new ArrayList<>();
        datas.add(new DBSingleBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));
        datas.add(new DBSingleBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new DBSingleBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new DBSingleBean("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new DBSingleBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));
        datas.add(new DBSingleBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new DBSingleBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new DBSingleBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }

} public class DBFlowSwipeActivity extends AppCompatActivity {
    ActivityDbflowSwipeBinding mBinding;
    SingleBindingAdapter mAdapter;
    List<FlowBean> mDatas;
    VGUtil mVGUtil;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.activity_dbflow_swipe, null, false);
        setContentView(mBinding.getRoot());

        mAdapter = new SingleBindingAdapter<>(this, mDatas = iniDatas(), R.layout.item_db_flow_swipe);
        mAdapter.setItemPresenter(new ItemDelPresenter());
        //ViewGroupUtils.addViews(mBinding.flowLayout, mAdapter);
        mVGUtil = new VGUtil.Builder()
                .setParent(mBinding.flowLayout)
                .setAdapter(mAdapter)
                .build()
                .bind();

    }

    public class ItemDelPresenter {
        public void onDelClick(FlowBean flowBean, View view) {
            mDatas.remove(flowBean);
            ((SwipeMenuLayout) view.getParent()).quickClose();
            //ViewGroupUtils.refreshUI(mBinding.flowLayout, mAdapter);
            mAdapter.notifyDatasetChanged();
        }
    }

    //没看头
    private List<FlowBean> iniDatas() {
        List<FlowBean> datas = new ArrayList<>();

/*        for (int i=0;i<10;i++){

        }*/
        datas.add(new FlowBean("我也不知道管我什么事的新闻"));
        datas.add(new FlowBean("体育"));

        datas.add(new FlowBean("吃瓜群众喜欢的"));
        datas.add(new FlowBean("军事"));
        datas.add(new FlowBean("娱乐圈"));

        datas.add(new FlowBean("我猜你也许喜欢的吧"));
        datas.add(new FlowBean("八卦"));
        datas.add(new FlowBean("老板让我随便推送的"));
        datas.add(new FlowBean("张旭童的那些事儿"));
        datas.add(new FlowBean("小马可以来了"));
        return datas;
    }
} public class GridViewActivity extends AppCompatActivity {
    GridView mGridView;

    private List<TestBean> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_grid_view);
        mGridView = (GridView) findViewById(R.id.gv);
        mGridView.setAdapter(new CommonAdapter<TestBean>(this, mDatas = initDatas(), R.layout.item_test) {
            @Override
            public void convert(ViewHolder holder, TestBean testBean, int position) {
                Log.d("TAG", "convert() called with: holder = [" + holder + "], testBean = [" + testBean + "], position = [" + position + "]");
                Glide.with(GridViewActivity.this)
                        .load(testBean.getAvatar())
                        .into((ImageView) holder.getView(R.id.ivAvatar));
                holder.setText(R.id.tvName, testBean.getName());
            }
        });
    }


    public List<TestBean> initDatas() {
        List<TestBean> datas = new ArrayList<>();
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));
        datas.add(new TestBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new TestBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new TestBean("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new TestBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new TestBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class ListViewSingleActivity extends AppCompatActivity {
    private static final String TAG = "zxt";
    private List<TestBean> mDatas;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_view_single);

        ListView listView = (ListView) findViewById(R.id.activity_list_view_single);
        listView.setAdapter(new CommonAdapter<TestBean>(this, mDatas = initDatas(), R.layout.item_test) {
            @Override
            public void convert(ViewHolder holder, TestBean testBean, int position) {
                Glide.with(ListViewSingleActivity.this)
                        .load(testBean.getAvatar())
                        .into((ImageView) holder.getView(R.id.ivAvatar));
                holder.setText(R.id.tvName, testBean.getName());
            }
        });
    }


    public List<TestBean> initDatas() {
        List<TestBean> datas = new ArrayList<>();
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));
        datas.add(new TestBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new TestBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new TestBean("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new TestBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new TestBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new TestBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }

} public class RvSingleActivity extends AppCompatActivity {
    private static final String TAG = "zxt";
    private List<TestBean> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rv_single);
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.activity_rv_single);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.setAdapter(new CommonAdapter<TestBean>(this, mDatas = initDatas(), R.layout.item_test) {
            @Override
            public void convert(ViewHolder holder, TestBean testBean) {
                Glide.with(RvSingleActivity.this)
                        .load(testBean.getAvatar())
                        .into((ImageView) holder.itemView.findViewById(R.id.ivAvatar));
                ((TextView) holder.itemView.findViewById(R.id.tvName)).setText(testBean.getName());
            }
        });
    }
} public class RvHeaderFooterActivity extends AppCompatActivity {
    private RecyclerView mRv;
    private List<TestBean> mDatas;
    private CommonAdapter mInnerAdapter;
    private HeaderFooterAdapter mHeaderFooterAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rv_header_footer);
        mRv = (RecyclerView) findViewById(R.id.rv);
        mRv.setLayoutManager(new LinearLayoutManager(this));
        mInnerAdapter = new CommonAdapter<TestBean>(this, mDatas = initDatas(), R.layout.item_test) {
            @Override
            public void convert(ViewHolder holder, TestBean testBean) {
                Glide.with(RvHeaderFooterActivity.this)
                        .load(testBean.getAvatar())
                        .into((ImageView) holder.itemView.findViewById(R.id.ivAvatar));
                ((TextView) holder.itemView.findViewById(R.id.tvName)).setText(testBean.getName());
            }
        };
        mHeaderFooterAdapter = new HeaderFooterAdapter(mInnerAdapter);
        //1-0 同步静态数据，借助实体类
        mHeaderFooterAdapter.setHeaderView(0, new HeaderBean("1-0 同步静态数据，借助实体类 点我跳转到多Type界面"));
        //1-1 同步静态数据，不借助实体类。
        mHeaderFooterAdapter.setHeaderView(1, new IHeaderHelper() {
            @Override
            public int getItemLayoutId() {
                return R.layout.header_1_1;
            }

            @Override
            public void onBind(ViewHolder holder) {
                holder.setText(R.id.tv1, "1-1  同步静态数据，不借助实体类。");
            }
        });


        mRv.setAdapter(mHeaderFooterAdapter);


        //2-1 异步数据，不借助实体类
        mRv.postDelayed(new Runnable() {
            @Override
            public void run() {
                mHeaderFooterAdapter.setHeaderView(2, new IHeaderHelper() {
                    @Override
                    public int getItemLayoutId() {
                        return R.layout.header_2_1;
                    }

                    @Override
                    public void onBind(ViewHolder holder) {
                        //假装从网络拿到了数据
                        HeaderBean temp = new HeaderBean("2-1 异步数据，不借助实体类");
                        holder.setText(R.id.tv2, temp.getText());
                    }
                });
                mHeaderFooterAdapter.notifyItemInserted(2);
            }
        }, 4000);

    }
} public class RvHeaderMulTypeActivity extends AppCompatActivity {

    private List<IMulTypeHelper> mDatas;

    private HeaderFooterAdapter mHeaderFooterAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rv_header_mul_type);
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        mDatas = initDatas();
        mHeaderFooterAdapter = new HeaderFooterAdapter(new BaseMulTypeAdapter(this, mDatas) {
            @Override
            public void convert(ViewHolder holder, final IMulTypeHelper iMulTypeHelper) {
                super.convert(holder, iMulTypeHelper);

                switch (iMulTypeHelper.getItemLayoutId()) {
                    case R.layout.item_rv_mulbean_1:
                        holder.setOnClickListener(R.id.tv, new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                MulTypeMulBean1 mulTypeMulBean1 = (MulTypeMulBean1) iMulTypeHelper;
                                Toast.makeText(mContext, mulTypeMulBean1.getName(), Toast.LENGTH_SHORT).show();
                            }
                        });
                        break;
                    case R.layout.item_rv_mulbean_2:
                        holder.setOnClickListener(R.id.banner, new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                Toast.makeText(mContext, "你想调到哪里", Toast.LENGTH_SHORT).show();
                            }
                        });
                        break;
                }
            }
        });
        //1-0 同步静态数据，借助实体类
        mHeaderFooterAdapter.setHeaderView(0, new HeaderBean("1-0 同步静态数据，借助实体类 点我跳转到多Type界面"));
        recyclerView.setAdapter(mHeaderFooterAdapter);

    }


    public List<IMulTypeHelper> initDatas() {
        List<IMulTypeHelper> datas = new ArrayList<>();
        datas.add(new MulTypeMulBean2("http://desk.fd.zol-img.com.cn/t_s960x600c5/g5/M00/01/0E/ChMkJlbKwaOIN8zJAAs5DadIS-IAALGbQPo5ngACzkl365.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));

        datas.add(new MulTypeMulBean2("http://cdn.duitang.com/uploads/item/201610/20/20161020070310_c5xWi.jpeg"));

        datas.add(new MulTypeMulBean1("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new MulTypeMulBean1("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));

        datas.add(new MulTypeMulBean2("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1512/31/c4/17105160_1451572371249_800x800.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class RvMulTypeMulBeanActivity extends AppCompatActivity {

    private List<IMulTypeHelper> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_rv_mul_type_mul_bean);
        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.activity_rv_mul_type_mul_bean);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        mDatas = initDatas();

        recyclerView.setAdapter(new BaseMulTypeAdapter(this, mDatas) {
            @Override
            public void convert(ViewHolder holder, final IMulTypeHelper iMulTypeHelper) {
                super.convert(holder, iMulTypeHelper);

                switch (iMulTypeHelper.getItemLayoutId()) {
                    case R.layout.item_rv_mulbean_1:
                        holder.setOnClickListener(R.id.tv, new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                MulTypeMulBean1 mulTypeMulBean1 = (MulTypeMulBean1) iMulTypeHelper;
                                Toast.makeText(mContext, mulTypeMulBean1.getName(), Toast.LENGTH_SHORT).show();
                            }
                        });
                        break;
                    case R.layout.item_rv_mulbean_2:
                        holder.setOnClickListener(R.id.banner, new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                Toast.makeText(mContext, "你想调到哪里", Toast.LENGTH_SHORT).show();
                            }
                        });
                        break;
                }
            }
        });

    }


    public List<IMulTypeHelper> initDatas() {
        List<IMulTypeHelper> datas = new ArrayList<>();
        datas.add(new MulTypeMulBean2("http://desk.fd.zol-img.com.cn/t_s960x600c5/g5/M00/01/0E/ChMkJlbKwaOIN8zJAAs5DadIS-IAALGbQPo5ngACzkl365.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));

        datas.add(new MulTypeMulBean2("http://cdn.duitang.com/uploads/item/201610/20/20161020070310_c5xWi.jpeg"));

        datas.add(new MulTypeMulBean1("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童"));
        datas.add(new MulTypeMulBean1("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.kejik.com/image/1460343965520.jpg", "多种type"));
        datas.add(new MulTypeMulBean1("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));

        datas.add(new MulTypeMulBean2("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1512/31/c4/17105160_1451572371249_800x800.jpg"));

        datas.add(new MulTypeMulBean1("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new MulTypeMulBean1("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class FakerGridViewActivity extends AppCompatActivity {

    VGUtil mVGUtil;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_faker_grid_view);
        FakerGridView fakerGridView = (FakerGridView) findViewById(R.id.fgv);
        //多种ItemViewType，但是数据结构相同，可以传入数据结构泛型，避免强转
        mVGUtil = new VGUtil(fakerGridView, new SingleAdapter<MulTypeBean>(this, initDatas(), R.layout.item_mul_1) {
            @Override
            public void onBindViewHolder(ViewGroup parent, ViewHolder holder, final MulTypeBean data, int pos) {
                holder.setText(R.id.tvWords, data.getName() + "");
                Glide.with(FakerGridViewActivity.this)
                        .load(data.getAvatar())
                        .into((ImageView) holder.getView(R.id.ivAvatar));
                //#### Adapter.onBindView()里设置 优先级更高
                holder.itemView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(mContext, "onBindView里设置:文字是:" + data.getName(), Toast.LENGTH_SHORT).show();
                    }
                });
            }
        })
                .bind();


    }

    public List<MulTypeBean> initDatas() {
        List<MulTypeBean> datas = new ArrayList<>();
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "0").setReceive(true));
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "1张"));
        datas.add(new MulTypeBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "2旭童").setReceive(true));
        datas.add(new MulTypeBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "3多种type"));
        datas.add(new MulTypeBean("http://www.kejik.com/image/1460343965520.jpg", "4多种type").setReceive(true));
        datas.add(new MulTypeBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "5多种type"));
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "6多种type"));
        datas.add(new MulTypeBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "7多种type"));
        return datas;
    }
} public class FlowSwipeActivity extends AppCompatActivity {
    FlowViewGroup mFlowViewGroup;
    IViewGroupAdapter mAdapter;
    List<FlowBean> mDatas;

    VGUtil mVGUtil;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_swipe_menu);
        mFlowViewGroup = (FlowViewGroup) findViewById(R.id.flowLayout);
        mAdapter = new SingleAdapter<FlowBean>(this, mDatas = iniDatas(), R.layout.item_flow) {
            @Override
            public void onBindViewHolder(ViewGroup parent, final ViewHolder holder, final FlowBean data, int pos) {
                TextView tv = holder.getView(R.id.tv);
                tv.setText(data.getTag());
                //点击事件只能在这里设置 因为ItemView是侧滑控件
                tv.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(FlowSwipeActivity.this, "点击了:" + data.getTag(), Toast.LENGTH_SHORT).show();
                    }
                });
                //侧滑菜单的事件设置
                holder.setOnClickListener(R.id.btnDel, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        mDatas.remove(data);
                        ((SwipeMenuLayout) holder.itemView).quickClose();
                        mVGUtil.bind();
                    }
                });
            }


        };
        mVGUtil = new VGUtil(mFlowViewGroup, mAdapter)
                .bind();

    }

    //没看头
    private List<FlowBean> iniDatas() {
        List<FlowBean> datas = new ArrayList<>();

/*        for (int i=0;i<10;i++){

        }*/
        datas.add(new FlowBean("我也不知道管我什么事的新闻"));
        datas.add(new FlowBean("体育"));

        datas.add(new FlowBean("吃瓜群众喜欢的"));
        datas.add(new FlowBean("军事"));
        datas.add(new FlowBean("娱乐圈"));

        datas.add(new FlowBean("我猜你也许喜欢的吧"));
        datas.add(new FlowBean("八卦"));
        datas.add(new FlowBean("老板让我随便推送的"));
        datas.add(new FlowBean("张旭童的那些事儿"));
        datas.add(new FlowBean("小马可以来了"));
        return datas;
    }
} public class LinearLayoutActivity extends AppCompatActivity {
    private static final String TAG = "zxt";
    private List<K50Bean> mDatas;
    private LinearLayout llCurrent, llUseMore, llRecent;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_linear_layout);
        llCurrent = (LinearLayout) findViewById(R.id.llCurrent);
        llUseMore = (LinearLayout) findViewById(R.id.llUseMore);
        llRecent = (LinearLayout) findViewById(R.id.llRecent);
        mDatas = initDatas();


        final SingleAdapter adapter1 = new SingleAdapter<K50Bean>(this, mDatas, R.layout.item_50k) {
            @Override
            public void onBindViewHolder(ViewGroup parent, ViewHolder holder, K50Bean data, int pos) {
                holder.setText(R.id.tv, data.getName());
            }
        };

        //单一ItemView
        //ViewGroupUtils.addViews(llCurrent, adapter1);
        final VGUtil vgUtil = new VGUtil(llCurrent, adapter1, new OnItemClickListener() {
            @Override
            public void onItemClick(ViewGroup parent, View itemView, int position) {
                Toast.makeText(LinearLayoutActivity.this, "position：" + position + "被删除了", Toast.LENGTH_SHORT).show();
                mDatas.remove(position);
                adapter1.notifyDatasetChanged();
            }
        });
        vgUtil.bind();

        new VGUtil.Builder()
                .setParent(llUseMore)
                .setAdapter(new SingleAdapter<K50Bean>(this, mDatas, R.layout.item_50k) {
                    @Override
                    public void onBindViewHolder(ViewGroup parent, ViewHolder holder, K50Bean data, int pos) {
                        holder.setText(R.id.tv, data.getName());
                    }
                })
                .build()
                .bind();
/*        ViewGroupUtils.addViews(llRecent, new SingleAdapter<K50Bean>(this, mDatas, R.layout.item_50k) {
            @Override
            public void onBindViewHolder(ViewGroup parent, ViewHolder holder, K50Bean data, int pos) {
                holder.setText(R.id.tv, data.getName());
            }
        });*/
        new VGUtil.Builder()
                .setParent(llRecent)
                .setAdapter(new SingleAdapter<K50Bean>(this, mDatas, R.layout.item_50k) {
                    @Override
                    public void onBindViewHolder(ViewGroup parent, ViewHolder holder, K50Bean data, int pos) {
                        holder.setText(R.id.tv, data.getName());
                    }
                })
                .build()
                .bind();


        findViewById(R.id.btnChange).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                for (K50Bean data : mDatas) {
                    data.setName("替换了");
                }

                //单一ItemView刷新
                //ViewGroupUtils.refreshUI(llCurrent, adapter1);
                adapter1.notifyDatasetChanged();
            }
        });

    }

    public List<K50Bean> initDatas() {
        List<K50Bean> datas = new ArrayList<>();
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        datas.add(new K50Bean("自行车"));
        return datas;
    }
} public class MulTypeActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mul_type);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.activity_mul_type);

        //设置OnItemClickListener
        OnItemClickListener onItemClickListener = new OnItemClickListener() {
            @Override
            public void onItemClick(ViewGroup parent, View itemView, int position) {
                Toast.makeText(MulTypeActivity.this, "通过OnItemClickListener设置:" + position, Toast.LENGTH_SHORT).show();
            }
        };

        //多种ItemViewType，但是数据结构相同，可以传入数据结构泛型，避免强转
/*        ViewGroupUtils.addViews(linearLayout, new MulTypeAdapter<MulTypeBean>(this, initDatas()) {
            @Override
            public void onBindViewHolder(ViewGroup parent, ViewHolder holder, final MulTypeBean data, int pos) {
                holder.setText(R.id.tvWords, data.getName() + "");
                Glide.with(MulTypeActivity.this)
                        .load(data.getAvatar())
                        .into((ImageView) holder.findViewById(ivAvatar));
                //#### Adapter.onBindView()里设置 优先级更高
                holder.itemView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(mContext, "onBindView里设置:文字是:" + data.getName(), Toast.LENGTH_SHORT).show();
                    }
                });
            }

        }, onItemClickListener);*/
        //2017 06 12 V1.8.0 建议使用Builder模式构建VGUtil
        new VGUtil.Builder()
                .setParent(linearLayout)
                .setAdapter(new MulTypeAdapter<MulTypeBean>(this, initDatas()) {
                    @Override
                    public void onBindViewHolder(ViewGroup parent, ViewHolder holder, final MulTypeBean data, int pos) {
                        holder.setText(R.id.tvWords, data.getName() + "");
                        Glide.with(MulTypeActivity.this)
                                .load(data.getAvatar())
                                .into((ImageView) holder.findViewById(ivAvatar));
                        //#### Adapter.onBindView()里设置 优先级更高
                        holder.itemView.setOnClickListener(new View.OnClickListener() {
                            @Override
                            public void onClick(View view) {
                                Toast.makeText(mContext, "onBindView里设置:文字是:" + data.getName(), Toast.LENGTH_SHORT).show();
                            }
                        });
                    }

                })
                .setOnItemClickListener(onItemClickListener)
                .build()
                .bind();

        //可以在`ViewGroupUtils.addViews`直接作为参数传入.\
        // 也可以用`ViewGroupUtils.setOnItemClickListener(）`设置
        // **优先级比`Adapter.onBindView()`里设置低，**
        //ViewGroupUtils.setOnItemClickListener(linearLayout,onItemClickListener);

    }


    public List<MulTypeBean> initDatas() {
        List<MulTypeBean> datas = new ArrayList<>();
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_04/2016_04_12/201604124411460430531500.jpg", "多种type").setReceive(true));
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_03/2016_03_25/201603259771458878793312_origin.jpg", "张"));
        datas.add(new MulTypeBean("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg", "旭童").setReceive(true));
        datas.add(new MulTypeBean("http://news.k618.cn/tech/201604/W020160407281077548026.jpg", "多种type"));
        datas.add(new MulTypeBean("http://www.kejik.com/image/1460343965520.jpg", "多种type").setReceive(true));
        datas.add(new MulTypeBean("http://cn.chinadaily.com.cn/img/attachement/jpg/site1/20160318/eca86bd77be61855f1b81c.jpg", "多种type"));
        datas.add(new MulTypeBean("http://imgs.ebrun.com/resources/2016_04/2016_04_24/201604244971461460826484_origin.jpeg", "多种type"));
        datas.add(new MulTypeBean("http://www.lnmoto.cn/bbs/data/attachment/forum/201408/12/074018gshshia3is1cw3sg.jpg", "多种type"));
        return datas;
    }
} public class MulTypeMulBeanActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mul_type_mul_bean);

        List datas = new ArrayList();
        for (int i = 0; i < 10; i++) {
            datas.add(new MulBean1("http://p14.go007.com/2014_11_02_05/a03541088cce31b8_1.jpg"));
            datas.add(new MulBean2("张旭童"));
        }


        //多种Item类型：数据结构不同 不传泛型了 使用时需要强转javaBean，判断ItemLayoutId
        /*ViewGroupUtils.addViews((ViewGroup) findViewById(R.id.activity_mul_type_mul_bean), new MulTypeAdapter(this, datas) {
            @Override
            public void onBindViewHolder(ViewGroup parent, ViewHolder holder, IMulTypeHelper data, int pos) {
                switch (data.getItemLayoutId()) {
                    case R.layout.item_mulbean_1:
                        MulBean1 mulBean1 = (MulBean1) data;
                        Glide.with(MulTypeMulBeanActivity.this)
                                .load(mulBean1.getUrl())
                                .into((ImageView) holder.itemView);
                        break;
                    case R.layout.item_mulbean_2:
                        MulBean2 mulBean2 = (MulBean2) data;
                        TextView tv = (TextView) holder.itemView;
                        tv.setText(mulBean2.getName());
                }
            }

        });*/
        //V1.8.0 建议使用Builder模式构建VGUtil
        new VGUtil.Builder()
                .setParent((ViewGroup) findViewById(R.id.activity_mul_type_mul_bean))
                .setAdapter(new MulTypeAdapter(this, datas) {
                    @Override
                    public void onBindViewHolder(ViewGroup parent, ViewHolder holder, IMulTypeHelper data, int pos) {
                        switch (data.getItemLayoutId()) {
                            case R.layout.item_mulbean_1:
                                MulBean1 mulBean1 = (MulBean1) data;
                                Glide.with(MulTypeMulBeanActivity.this)
                                        .load(mulBean1.getUrl())
                                        .into((ImageView) holder.itemView);
                                break;
                            case R.layout.item_mulbean_2:
                                MulBean2 mulBean2 = (MulBean2) data;
                                TextView tv = (TextView) holder.itemView;
                                tv.setText(mulBean2.getName());
                        }
                    }

                })
                .build()
                .bind();
    }
} public class ScrollViewDemoActivity extends AppCompatActivity {
    private static final String TAG = "zxt";
    HorizontalScrollView mScrollView;
    LinearLayout mLlcontainer;
    ImageView mAvatar;

    List<ProgressBar> animPbs;
    private List<VipLevelBean> mDatas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scroll_view_demo);
        mScrollView = (HorizontalScrollView) findViewById(R.id.hsv);
        mLlcontainer = (LinearLayout) findViewById(R.id.llContainer);
        mLlcontainer.post(new Runnable() {
            @Override
            public void run() {
                animPbs = new ArrayList<ProgressBar>();

                ViewGroupUtils.addViews(mLlcontainer, new BaseAdapter<VipLevelBean>(ScrollViewDemoActivity.this, mDatas = initDatas()) {
                            @Override
                            public void recycleView(ViewGroup parent, ViewHolder holder) {

                            }

                            @Override
                            public void recycleViews(ViewGroup parent) {

                            }

                            @Override
                            public View getView(ViewGroup parent, int pos, VipLevelBean data) {
                                View itemView;
                                TextView tvLevel;
                                ProgressBar pb;
                                if (data.isCurrent()) {
                                    itemView = mInflater.inflate(R.layout.item_current, parent, false);
                                    mAvatar = (ImageView) itemView.findViewById(R.id.ivAvatar);
                                } else {
                                    itemView = mInflater.inflate(R.layout.item_normal, parent, false);
                                }
                                tvLevel = (TextView) itemView.findViewById(R.id.tvLevel);
                                pb = (ProgressBar) itemView.findViewById(R.id.pb);
 /*                               itemView.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        Toast.makeText(mContext, "itemView ", Toast.LENGTH_SHORT).show();
                                    }
                                });*/
                                tvLevel.setOnClickListener(new View.OnClickListener() {
                                    @Override
                                    public void onClick(View view) {
                                        Toast.makeText(mContext, "textview", Toast.LENGTH_SHORT).show();
                                    }
                                });

                                animPbs.add(pb);
                        /*if (pos == getCount() - 1) {
                            //开始动画
                            beginAnim(animPbs, mScrollView, mDatas, mAvatar);
                        }*/

                                tvLevel.setText(data.getLevel() + "");
                                return itemView;
                            }
                        }, true
                        , new OnItemClickListener() {
                            @Override
                            public void onItemClick(ViewGroup parent, View itemView, int position) {
                                Toast.makeText(ScrollViewDemoActivity.this, "click:" + position, Toast.LENGTH_SHORT).show();
                            }
                        }
                        , new OnItemLongClickListener() {
                            @Override
                            public boolean onItemLongClick(ViewGroup parent, View itemView, int position) {
                                Toast.makeText(ScrollViewDemoActivity.this, "long click:" + position, Toast.LENGTH_SHORT).show();
                                return false;
                            }
                        });
            }
        });

        findViewById(R.id.btnAnim).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //开始动画
                beginAnim(animPbs, mScrollView, mDatas, mAvatar);
            }
        });
    }

    private void beginAnim(final List<ProgressBar> animPbs, final HorizontalScrollView horizontalScrollView, List<VipLevelBean> datas, ImageView avatar) {
        //动画分两部分，一分部是 进度条的填充，另一部分是ScrollView的滚动
        int size = animPbs.size();
        AnimatorSet set = new AnimatorSet();
        List<Animator> anims = new ArrayList<Animator>(size);
        int perAnimTime = 500;
        for (int i = 0; i < size; i++) {
            ValueAnimator anim = ValueAnimator.ofInt(0, 100);
            final int finalI = i;
            anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                @Override
                public void onAnimationUpdate(ValueAnimator animation) {
                    ProgressBar pb = animPbs.get(finalI);
                    pb.setProgress((Integer) animation.getAnimatedValue());

                    /*horizontalScrollView.scrollTo(pb.getWidth() * finalI, 0);*/
                    //horizontalScrollView.scrollTo((int) (pb.getWidth() * finalI + ((float) animation.getAnimatedValue() / 100) * pb.getWidth()), 0);
                }
            });
            anims.add(anim);
        }
        set.playSequentially(anims);
        set.setDuration(perAnimTime);


        //滚动ScrollView 至当前等级头像在屏幕中央

        int left = 0;
        //先找到当前等级
        int measuredWidth = mLlcontainer.getChildAt(0).getMeasuredWidth();
        Log.d(TAG, "beginAnim() called with: animPbs = [" + measuredWidth);

        int curLevel = 0;
        for (int i = 0; i < datas.size(); i++) {
            if (datas.get(i).isCurrent()) {
                curLevel = i;
                left = measuredWidth * i;
            }
        }

        /*left = avatar.getLeft();
        Log.d(TAG, "beginAnim() called with: left = [" + left);*/
        int width = avatar.getMeasuredWidth();
        int target = left + width / 2;
        Log.d(TAG, "beginAnim() called with: target = [" + target);

        int screenWidth = getResources().getDisplayMetrics().widthPixels;
        Log.d(TAG, "beginAnim() called with: screenWidth = [" + screenWidth);

        //最后的实验

        target = 0;
        for (int i = 0; i < datas.size(); i++) {
            if (datas.get(i).isCurrent()) {
                target = target + avatar.getLeft() + avatar.getMeasuredWidth() / 2;
                break;
            } else {
                target = target + mLlcontainer.getChildAt(i).getMeasuredWidth();
                Log.d(TAG, "mLlcontainer.getChildAt(i).getMeasuredWidth() = [" + mLlcontainer.getChildAt(i).getMeasuredWidth());
            }
        }


        ValueAnimator valueAnimator = ValueAnimator.ofInt(0, target - screenWidth / 2);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                mScrollView.scrollTo((Integer) animation.getAnimatedValue(), 0);
            }
        });
        valueAnimator.setDuration(curLevel * perAnimTime);

        valueAnimator.start();
        set.start();
    }


    public List initDatas() {
        List<VipLevelBean> datas = new ArrayList<>();
        datas.add(new VipLevelBean(1));
        datas.add(new VipLevelBean(2));
        datas.add(new VipLevelBean(3));
        datas.add(new VipLevelBean(4));
        datas.add(new VipLevelBean(5).setCurrent(true));
        datas.add(new VipLevelBean(6));
        datas.add(new VipLevelBean(7));
        datas.add(new VipLevelBean(8));
        return datas;
    }
}
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import mcxtzhang.commonviewgroupadapter.databinding.rv.multype.DBMultypeSingleItemActivity;
import mcxtzhang.commonviewgroupadapter.databinding.rv.multype.mulbean.DBMulTypeMulBeanActivity;
import mcxtzhang.commonviewgroupadapter.databinding.rv.single.DBSingleActivity;
import mcxtzhang.commonviewgroupadapter.databinding.viewgroup.DBFlowSwipeActivity;
import mcxtzhang.commonviewgroupadapter.lvgv.GridViewActivity;
import mcxtzhang.commonviewgroupadapter.lvgv.ListViewSingleActivity;
import mcxtzhang.commonviewgroupadapter.rv.RvSingleActivity;
import mcxtzhang.commonviewgroupadapter.rv.header.RvHeaderFooterActivity;
import mcxtzhang.commonviewgroupadapter.rv.header.RvHeaderMulTypeActivity;
import mcxtzhang.commonviewgroupadapter.rv.mul.RvMulTypeMulBeanActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.fakergrid.FakerGridViewActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.flowswipe.FlowSwipeActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.linearlayout.LinearLayoutActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.multype.MulTypeActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.multype.mulbean.MulTypeMulBeanActivity;
import mcxtzhang.commonviewgroupadapter.viewgroup.scrollview.ScrollViewDemoActivity;
package mcxtzhang.commonviewgroupadapter;



public class LauncherActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_launcher);

        //Viewgroup
        findViewById(R.id.btnLinearLayout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, LinearLayoutActivity.class));
            }
        });

        findViewById(R.id.btnScrollView).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, ScrollViewDemoActivity.class));
            }
        });

        findViewById(R.id.btnMulType).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, MulTypeActivity.class));
            }
        });

        findViewById(R.id.btnMulTypeMulBean).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, MulTypeMulBeanActivity.class));
            }
        });

        findViewById(R.id.btnFlowSwipe).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, FlowSwipeActivity.class));
            }
        });


        //rv
        findViewById(R.id.btnRvSingle).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(LauncherActivity.this, RvSingleActivity.class));