Add support for creating viewholder with just a view to better support viewbinding

This commit is contained in:
Ensar Sarajčić 2023-08-03 12:53:03 +02:00
parent 713d3d9753
commit a8ebd38380
2 changed files with 8 additions and 0 deletions

View file

@ -300,6 +300,10 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc
return ViewHolder(view)
}
protected fun createViewHolder(view: View): ViewHolder {
return ViewHolder(view)
}
protected fun bindViewHolder(holder: ViewHolder) {
holder.itemView.tag = holder
}

View file

@ -317,6 +317,10 @@ abstract class MyRecyclerViewListAdapter<T>(
return ViewHolder(view)
}
protected fun createViewHolder(view: View): ViewHolder {
return ViewHolder(view)
}
protected fun bindViewHolder(holder: ViewHolder) {
holder.itemView.tag = holder
}