Skip to content
dexafree edited this page Nov 20, 2014 · 3 revisions

Introduction

As some of you will have noticed, when you read the Google's Design Guidelines about the Cards and how to use it, now there's a thing that wasn't previously there: Dividers between the content and the buttons.

When I started developing MaterialList, those dividers weren't there, but now they are, and as MaterialList was born aiming to get an exact representation of the Cards showed at the guidelines, I've included them. I don't personally like them, but I didn't want to get away from the main path, so I've managed to offer you an easy way so you can decide whether to show them or not.

Showing dividers in your Cards

By default, in the cards that have Buttons (BasicImageButtonsCard, BasicButtonsCard and BigImageButtonsCard) the divider will not be shown. In order to show it, when you declare your card, you must call the setShowDivider(true) method.

In addition, for those who don't like the divider going all the way from side to side of the card, I've added another method, called setFullDividerLength(false) that will make the divider fill all the parent, or leave a little margin from it.

Examples

As an image is worth a thousand words, here you have some combinations and how to achieve them:

BigImageButtonsCard with Divider without full length

BigImageButtonsCard

BigImageButtonsCard card = new BigImageButtonsCard();

// Set title, description, image, buttons...

card.setShowDivider(true);
card.setFullDividerLength(false);

BigImageButtonsCard with Divider at full length

BigImageButtonsCard

BigImageButtonsCard card = new BigImageButtonsCard();

// Set title, description, image, buttons...

card.setShowDivider(true);
card.setFullDividerLength(true);

Notice that if you don't call the .setShowDivider(true) method, the divider will not be shown at all.