Android Programming The Big Nerd Ranch Guide, 3rd Edition

(Brent) #1

Chapter 8  Displaying Lists with RecyclerView


158

Figure 8.2 shows the overall plan for CriminalIntent in this chapter.


Figure 8.2  CriminalIntent with a list of crimes


In the model layer, you have a new object, CrimeLab, that will be a centralized data stash for Crime
objects.


Displaying a list of crimes requires a new activity and a new fragment in CriminalIntent’s controller
layer: CrimeListActivity and CrimeListFragment.


(Where are CrimeActivity and CrimeFragment in Figure 8.2? They are part of the detail view,
so we are not showing them here. In Chapter 10, you will connect the list and the detail parts of
CriminalIntent.)


In Figure 8.2, you can also see the view objects associated with CrimeListActivity and
CrimeListFragment. The activity’s view will consist of a fragment-containing FrameLayout. The
fragment’s view will consist of a RecyclerView. You will learn more about the RecyclerView class
later in the chapter.

Free download pdf