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:
commit
c5a32fb1f3
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue