Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)

(gtxtreme123) #1

View Components


View Components


The material design guidelines specify a few kinds of view components that were new in Lollipop. The
Android team provides implementations of many of these components. Let’s take a look at a few of the
views you are likely to run into.


Cards


The first new widget is a frame for other widgets: cards (Figure 35.10).


Figure 35.10  Cards


A card is a container for other kinds of content. It is elevated slightly, with a shadow behind it, and its
corners are slightly rounded.


This is not a design book, so we cannot provide advice on when and where to use cards. (See Google’s
material design documentation on the web if you are curious: http://www.google.com/design/spec.)) We can
tell you how to make them, though: by using CardView.


CardView is a class provided in its own v7 support library, much like RecyclerView. You can include it
in your project by adding a dependency on com.android.support:cardview-v7 to your module.

Free download pdf