use of com.litingzhe.justandroid.ui.listandGridView.recyleDivider.DividerGridItemDecoration in project JustAndroid by chinaltz.
the class SimpleRecyleViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_single_recyclerview);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayShowTitleEnabled(false);
navToolBarBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
toolbarTitle.setText("RecycleView简单使用");
initData();
mAdapter = new SimpleRecyleViewAdapter(this, mDatas);
mRecyclerView.setLayoutManager(new StaggeredGridLayoutManager(4, StaggeredGridLayoutManager.VERTICAL));
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.addItemDecoration(new DividerGridItemDecoration(this));
// 设置item动画
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
initEvent();
}
Aggregations