use of carbon.component.DefaultImageTextSubtextDateItem in project Carbon by ZieIony.
the class ImageTextSubtextDateListItemActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_listcomponent);
Samples.initToolbar(this, getString(R.string.imageTextSubtextDateListItemActivity_title));
RecyclerView recycler = (RecyclerView) findViewById(R.id.recycler);
recycler.setLayoutManager(new LinearLayoutManager(this));
RowListAdapter adapter = new RowListAdapter<>(DefaultImageTextSubtextDateItem.class, ImageTextSubtextDateRow::new);
adapter.addFactory(DefaultHeaderItem.class, PaddedHeaderRow.FACTORY);
recycler.setAdapter(adapter);
Drawable drawable = getResources().getDrawable(R.drawable.watermelon);
String date = format.format(new Date().getTime());
adapter.setItems(Arrays.asList(new DefaultHeaderItem("Header"), new DefaultImageTextSubtextDateItem(drawable, "text", "subtext", date), new DefaultImageTextSubtextDateItem(drawable, "text", "subtext", date), new DefaultHeaderItem("Header"), new DefaultImageTextSubtextDateItem(drawable, "text", "subtext", date), new DefaultImageTextSubtextDateItem(drawable, "text", "subtext", date)));
}
Aggregations