Component - Why dynamic lists display data efficiently
This UI component shows a dynamic list that efficiently displays many items by reusing views as you scroll. It helps apps run smoothly without using too much memory.
This UI component shows a dynamic list that efficiently displays many items by reusing views as you scroll. It helps apps run smoothly without using too much memory.
RecyclerView
└── Adapter
├── ViewHolder (Item View)
├── ViewHolder (Item View)
└── ...override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
holder.textView.text = dataList[position]
}override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item, null)
return MyViewHolder(view)
}Pass the test and this pattern moves unknown