Created
March 29, 2020 18:05
-
-
Save pavlospt/45c9957f9c95023e7b4f6d1c4329a1cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import androidx.recyclerview.widget.RecyclerView | |
| import androidx.viewbinding.ViewBinding | |
| abstract class ViewBindingViewHolder<Item : ViewBindingAdapterItem, out VB : ViewBinding>( | |
| protected val binding: VB | |
| ) : RecyclerView.ViewHolder(binding.root) { | |
| abstract fun bind(item: Item) | |
| open fun bind(item: Item, payloads: List<Any>) { | |
| if (payloads.isEmpty()) { | |
| bind(item = item) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment