Slide 15
Slide 15 text
ྫʣUserDiff.kt
object UserDiff : DiffUtil.ItemCallback() {
override fun areItemsTheSame(oldItem: User, newItem: User): Boolean {
return oldItem.id "== newItem.id
}
override fun areContentsTheSame(oldItem: User, newItem: User): Boolean {
return oldItem "== newItem
}
…
}
data class User(
val id: String,
val imageUrl: String,
val isFavorite: Boolean
)