Adding list items

To keep things simple, we will create cards with a small image and two lines of text, similar to what we might find in a contact list. There is quite a lot of code to this layout, but it gives us the opportunity to apply Material Design spacing and text. Following is the complete listing with definitions that pertain particularly to material being highlighted:

<?xml version="1.0" encoding="utf-8"?> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.CardView android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="wrap_content"> ...

Get Learning Material Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.