Android Programming The Big Nerd Ranch Guide by Bill Phillips, Chris Stewart, Kristin Marsicano (z-lib.org)
8. Displaying Lists with RecyclerView CriminalIntent’s model layer currently consists of a single instance of Crime. In this cha ...
Chapter 8 Displaying Lists with RecyclerView Figure 8.2 shows the overall plan for CriminalIntent in this chapter. Figure 8.2 ...
Updating CriminalIntent’s Model Layer Updating CriminalIntent’s Model Layer The first step is to upgrade CriminalIntent’s model ...
Chapter 8 Displaying Lists with RecyclerView Let’s give CrimeLab some Crime objects to store. In CrimeLab’s constructor, create ...
An Abstract Activity for Hosting a Fragment Eventually, the List will contain user-created Crimes that can be saved and reloaded ...
Chapter 8 Displaying Lists with RecyclerView When you rename a resource, the references to it should be updated automatically. ...
An abstract Activity class Nearly every activity you will create in this book will require the same code. To avoid typing it aga ...
Chapter 8 Displaying Lists with RecyclerView Using an abstract class Try it out with CrimeActivity. Change CrimeActivity’s supe ...
An abstract Activity class The CrimeListFragment class has not yet been created. Let’s remedy that. Right-click on the com.bigne ...
Chapter 8 Displaying Lists with RecyclerView CrimeListActivity is now the launcher activity. Run CriminalIntent and you will se ...
RecyclerView, Adapter, and ViewHolder RecyclerView, Adapter, and ViewHolder Now, you want CrimeListFragment to display a list of ...
Chapter 8 Displaying Lists with RecyclerView ViewHolders and Adapters The RecyclerView’s only responsibilities are recycling Te ...
ViewHolders and Adapters A RecyclerView never creates Views by themselves. It always creates ViewHolders, which bring their item ...
Chapter 8 Displaying Lists with RecyclerView When the RecyclerView needs a view object to display, it will have a conversation ...
Using a RecyclerView Using a RecyclerView Enough talk; time for the implementation. The RecyclerView class lives in one of Googl ...
Chapter 8 Displaying Lists with RecyclerView Now that CrimeListFragment’s view is set up, hook up the view to the fragment. Mod ...
A view to display A view to display Each item displayed on the RecyclerView will have its own view hierarchy, exactly the way Cr ...
Chapter 8 Displaying Lists with RecyclerView CrimeHolder is all skin and bones right now. Later in the chapter, CrimeHolder wil ...
Implementing a ViewHolder and an Adapter Now that you have an Adapter, connect it to your RecyclerView. Implement a method calle ...
Chapter 8 Displaying Lists with RecyclerView Run CriminalIntent and scroll through your new RecyclerView, which should look lik ...
«
5
6
7
8
9
10
11
12
13
14
»
Free download pdf