[Android Kotlin 기초] 7-2. RecyclerView fundamental

RecyclerView fundamental

1. Concept of RecyclerView


2. Adapter pattern


  1. onBindViewHolder
override fun onBindViewHolder(holder: TextItemViewHolder, position: Int) {
}
  1. onCreateViewHolder
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TextItemViewHolder {
}
  1. Why recyclerview need notify method
var data =  listOf<SleepNight>()
   set(value) {
       field = value
       notifyDataSetChanged()
   }

3. How view holders are recycled