Merge pull request #1776 from esensar/viewbinding-recycler-adapter

Add support for creating viewholder with just a view to better support viewbinding
This commit is contained in:
Tibor Kaputa 2023-08-03 13:13:13 +02:00 committed by GitHub
commit c5a32fb1f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}