Chapter 16. Adapters and Recyclers
In this brief chapter, we will achieve much. We will first go through the theory of adapters and lists. We will then look at how we can extend RecyclerAdapter
in Java code and add RecyclerView
, which acts as a list to our UI, and then, through the apparent magic of the Android API, bind them together so that RecyclerView
displays the contents of RecyclerAdapter
and allows the user to scroll through the contents. You have probably guessed that we will be using this technique to display our list of notes in the Note to Self app.
In this chapter, we will do the following:
- Look at the theory of adapters and binding them to our UI
- Implement the layout with
RecyclerView
- Lay out a list item for use in
RecyclerView
- Implement the adapter with
RecyclerAdapter
- Bind the adapter to
RecyclerView
- Store notes in
ArrayList
and display them inRecyclerView
- Discuss how we can improve the Note to Self app further
Soon, we will have a self-managing layout that holds and...