Last active
February 1, 2021 22:28
-
-
Save longv/8b4e159c3dd552c67af438531777cf8f to your computer and use it in GitHub Desktop.
DataBindingViewHolder for data binding RecyclerView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DataBindingViewHolder(private val viewBinding: ViewDataBinding): RecyclerView.ViewHolder(viewBinding.root) { | |
fun bind(bindingEntry: DataBindingEntry) { | |
viewBinding.apply { | |
bindingEntry.bindings.forEach { setVariable(it.key, it.value) } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment