Skip to content
Fabio Hellmann edited this page Feb 11, 2016 · 4 revisions

SmallImageCard

SmallImageCard is a simple card which shows a title, an icon, and a description.

V3

Card card = new Card.Builder(this)
		.withProvider(new CardProvider())
		.setLayout(R.layout.material_small_image_card)
		.setTitle("Card number 1")
		.setDescription("Lorem ipsum dolor sit amet")
		.setDrawable(R.drawable.photo)
		.endConfig()
		.build();

V2 (Deprecated)

For title and description, y For title and description, you only need to call the setTitle(String title) and setDescription(String description) methods

SmallImageCard card = new SmallImageCard(context);
card.setTitle("Your title");
card.setDescription("Your description");

In order to set the icon, you need to call the setBitmap() method, and pass it one of the following:

  • A Bitmap
  • A Context plus a resource id (such as R.drawable.my_icon)
  • A Drawable