Creating an Item View Layout

RecyclerView is a subclass of ViewGroup. It displays a list of child View objects, called item views. Each item view represents a single object from the list of data backing the recycler view (in your case, a single crime from the crime list). Depending on the complexity of what you need to display, these child Views can be complex or very simple.

For your first implementation, each item in the list will display the title and date of a Crime, as shown in Figure 9.5.

Figure 9.5  A RecyclerView with child Views

A RecyclerView with child Views

Each item displayed on the RecyclerView will have its own view hierarchy, exactly the ...

Get Android Programming: The Big Nerd Ranch Guide, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.