Search in sources :

Example 1 with DividerItemDecoration

use of com.zhy.sample.view.DividerItemDecoration in project AndroidAutoLayout by hongyangAndroid.

the class RecyclerViewFragment method initView.

private void initView() {
    mContext = getActivity();
    mRecyclerView = (RecyclerView) mView.findViewById(R.id.id_recyclerview);
    mList = new ArrayList<String>();
    for (int i = 0; i < 50; i++) {
        mList.add(i + "");
    }
    mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    mRecyclerView.setAdapter(new MyAdapter(getActivity(), mList));
    mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(com.zhy.sample.view.DividerItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 DividerItemDecoration (com.zhy.sample.view.DividerItemDecoration)1