Skip to content

Instantly share code, notes, and snippets.

@jungilhan
Last active May 11, 2018 03:54
Show Gist options
  • Save jungilhan/61d84fa07d678ac7839f0b1d1e1c868e to your computer and use it in GitHub Desktop.
Save jungilhan/61d84fa07d678ac7839f0b1d1e1c868e to your computer and use it in GitHub Desktop.
class NumberListAdapter : ListAdapter<Int, ViewHolder>(object : DiffUtil.ItemCallback<Int>() {
override fun areItemsTheSame(oldItem: Int?, newItem: Int?) =
oldItem == newItem // check uniqueness
override fun areContentsTheSame(oldItem: Int?, newItem: Int?) =
oldItem == newItem // check contents
}) {
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment