View on GitHub

reads

https://yazansneneh.github.io/reads/

Create dynamic lists with RecyclerView

Key classes

to build dynamic list, i need following classes:

  1. RecyclerView : it contains data, and i can only add it to screen.
  2. for each element in layout element holder will be created, and RecyclerView bind it to it’s data RecyclerView.ViewHolder.
  3. RecyclerView bind views to data by calling RecyclerView.Adapter method.
  4. layout manager arranges the individual elements in list.

Steps for implementing your RecyclerView

Plan your layout

Implementing adapter and view holder

Adapter and ViewHolder work together to define how 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.