Using of ConstraintLayout to build out CardView with Material Design
3 min readSep 14, 2017
Material design guidelines mention that cards can be constructed using blocks of content which include:
- An optional header
- A primary title
- Rich media
- Supporting text
- Actions
These blocks can be organized to promote different types of content. Let’s consider some possible combinations of content blocks to build cards and how they can be implemented using ConstraintLayout.
1 Media 16:9 and supporting text
2 Avatar, media 16:9, supporting text and action buttons
3 Avatar, media 16:9 and action buttons
4 Media 16:9, primary text, subtext, actions and expandable supporting text
5 Primary text, subtext, supporting text and actions
6 Media 16:9 and actions
7 Media 1:1, primary text, subtext and actions
8 Media 1x, primary text, subtext and actions
9 Media 1.5x, primary text, subtext and actions
10 Media 2x, primary text, subtext and actions
11 Media 3x and actions
You can find source code for all the examples above on GitHub.