Created
June 14, 2018 10:55
-
-
Save Marchuck/822d9cb57d406bded0393fa5b835a050 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
object PaginationItemCallback : DiffUtil.ItemCallback<Person?>() { | |
override fun areItemsTheSame(oldItem: Person?, newItem: Person?): Boolean { | |
if (oldItem == null || newItem == null) return false | |
return oldItem == newItem | |
} | |
override fun areContentsTheSame(oldItem: Person?, newItem: Person?): Boolean { | |
if (oldItem == null || newItem == null) return false | |
return oldItem.name == newItem.name | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment