Skip to content

Instantly share code, notes, and snippets.

@tonnylitao
Last active June 17, 2020 09:47
Show Gist options
  • Select an option

  • Save tonnylitao/787bf03f767f972d8faae57ed1c1c1ea to your computer and use it in GitHub Desktop.

Select an option

Save tonnylitao/787bf03f767f972d8faae57ed1c1c1ea to your computer and use it in GitHub Desktop.
override fun onBindViewHolder(
holder: ViewHolder,
position: Int
){
getItem(position)?.run(holder.binding::bind)
}
} //end of RecyclerAdapter
private fun ViewDataBinding.bind(
item: RecyclerItem
) {
setVariable(
item.variableId,
item.dataToBind
)
executePendingBindings()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment