reading-notes

Read: 28 - RecyclerView

Creating dynamic lists with RecyclerView:

  1. choose how the list is going to look like.
  2. Design how each element in the list is going to look and behave. Based on this design, extend the ViewHolder class. Your version of ViewHolder provides all the functionality for your list items. Your view holder is a wrapper around a View, and that view is managed by RecyclerView.
  3. Define the Adapter that associates your data with the ViewHolder views.
  4. Plan your layout.
  5. Implementing your adapter and view holder: create two classes; Adapter and ViewHolder. These two classes work together to define how your data is displayed.
    • The ViewHolder is a wrapper around a View that contains the layout for an individual item in the list.
    • The Adapter creates ViewHolder objects as needed, and also sets the data for those views. The process of associating views to their data is called binding.