use of com.chad.baserecyclerviewadapterhelper.adapter.multi.MultipleItemQuickAdapter in project BaseRecyclerViewAdapterHelper by CymChad.
the class MultiItemQuickUseActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_multiple_item_use);
setTitle("BaseMultiItemQuickAdapter");
setBackBtn();
RecyclerView mRecyclerView = findViewById(R.id.rv_list);
final List<QuickMultipleEntity> data = DataServer.getMultipleItemData();
final MultipleItemQuickAdapter multipleItemAdapter = new MultipleItemQuickAdapter(data);
final GridLayoutManager manager = new GridLayoutManager(this, 4);
mRecyclerView.setLayoutManager(manager);
multipleItemAdapter.setGridSpanSizeLookup(new GridSpanSizeLookup() {
@Override
public int getSpanSize(GridLayoutManager gridLayoutManager, int viewType, int position) {
return data.get(position).getSpanSize();
}
});
mRecyclerView.setAdapter(multipleItemAdapter);
}
Aggregations