Skip to content

Instantly share code, notes, and snippets.

@plusmobileapps
Created December 11, 2018 07:08
Show Gist options
  • Save plusmobileapps/ffe66834d53f7c4ff9d097bf9c9237d0 to your computer and use it in GitHub Desktop.
Save plusmobileapps/ffe66834d53f7c4ff9d097bf9c9237d0 to your computer and use it in GitHub Desktop.
class RecyclerViewDiffUtil : DiffUtil.ItemCallback<DataWrapper>() {
override fun areItemsTheSame(oldItem: DataWrapper, newItem: DataWrapper): Boolean {
return oldItem.id == newItem.id
}
override fun areContentsTheSame(oldItem: DataWrapper, newItem: DataWrapper): Boolean {
return oldItem == newItem
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment