use of me.drakeet.multitype.sample.normal.TextItem in project MultiType by drakeet.
the class SimpleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.list);
Items items = new Items();
adapter = new MultiTypeAdapter();
adapter.register(TextItem.class, new TextItemWithOutsizeDataViewBinder(aFieldValue));
recyclerView.setAdapter(adapter);
assertHasTheSameAdapter(recyclerView, adapter);
for (int i = 0; i < 20; i++) {
items.add(new TextItem(valueOf(i)));
}
adapter.setItems(items);
adapter.notifyDataSetChanged();
assertAllRegistered(adapter, items);
}
Aggregations