diff --git a/RecyclerViewKotlin/app/src/main/java/com/example/recyclersample/flowerList/FlowersAdapter.kt b/RecyclerViewKotlin/app/src/main/java/com/example/recyclersample/flowerList/FlowersAdapter.kt index 69ce3a1f..ec21e2bf 100644 --- a/RecyclerViewKotlin/app/src/main/java/com/example/recyclersample/flowerList/FlowersAdapter.kt +++ b/RecyclerViewKotlin/app/src/main/java/com/example/recyclersample/flowerList/FlowersAdapter.kt @@ -75,10 +75,10 @@ class FlowersAdapter(private val onClick: (Flower) -> Unit) : object FlowerDiffCallback : DiffUtil.ItemCallback() { override fun areItemsTheSame(oldItem: Flower, newItem: Flower): Boolean { - return oldItem == newItem + return oldItem.id == newItem.id } override fun areContentsTheSame(oldItem: Flower, newItem: Flower): Boolean { - return oldItem.id == newItem.id + return oldItem == newItem } } \ No newline at end of file