Add support for creating viewholder with just a view to better support viewbinding
This commit is contained in:
parent
713d3d9753
commit
a8ebd38380
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