Chapter 16: Adapters and Recyclers
In this brief chapter, we will achieve a lot. We will first go through the theory of adapters and lists – how we can extend the RecyclerAdapter
class in Java code and add a RecyclerView
instance that acts as a list to our UI – and then through the apparent magic of how the Android API binds 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 cover the following:
- Looking at the theory of adapters and binding them to our UI
- Implementing the layout with
RecyclerView
- Laying out a list item for use in
RecyclerView
- Implementing the adapter with
RecyclerAdapter
- Binding the adapter to
RecyclerView
- Storing notes in
ArrayList
and displaying them inRecyclerView
- Discussing how we can improve the...