Created
April 5, 2020 13:21
-
-
Save klukwist/f5eecbb4d976055a423144c745741086 to your computer and use it in GitHub Desktop.
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 ClassicHolder(private val binding: ItemPersonBinding) : RecyclerView.ViewHolder(binding.root) { | |
fun bind(viewModel: PersonItemViewModel, position: Int) { | |
binding.setVariable(BR.viewModel, viewModel) | |
binding.setVariable(BR.position, position) | |
binding.executePendingBindings() | |
} | |
companion object { | |
fun create(parent: ViewGroup): ClassicHolder { | |
val inflater = LayoutInflater.from(parent.context) | |
val binding: ItemPersonBinding = | |
DataBindingUtil.inflate(inflater, R.layout.item_person, parent, false) | |
return ClassicHolder(binding) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment