use of carbon.component.DividerItem in project Carbon by ZieIony.
the class AvatarTextListItemActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listcomponent);
Samples.initToolbar(this, getString(R.string.avatarTextListItemActivity_title));
RecyclerView recycler = (RecyclerView) findViewById(R.id.recycler);
RowListAdapter adapter = new RowListAdapter<>(DefaultAvatarTextItem.class, AvatarTextRow.FACTORY);
adapter.addFactory(DividerItem.class, DividerRow.FACTORY);
recycler.setAdapter(adapter);
Drawable avatar = getResources().getDrawable(R.drawable.iceland);
adapter.setItems(Arrays.asList(new DefaultAvatarTextItem(avatar, "text"), new DefaultAvatarTextItem(avatar, "text"), new DividerItem(), new DefaultAvatarTextItem(avatar, "text"), new DefaultAvatarTextItem(avatar, "text")));
}
Aggregations