Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #215 from android/update-agp-4-2-1 #233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Merge pull request #215 from android/update-agp-4-2-1 #233

wants to merge 1 commit into from

Conversation

StylianosGakis
Copy link

Fix DiffUtil.ItemCallback implementation

The areItemsTheSame documentation explicitly says:
"For example, if your items have unique ids, this method should check their id equality."

In the current state, the DiffUtil.ItemCallback is implemented wrong.

override fun areItemsTheSame(oldItem: Flower, newItem: Flower): Boolean {
return oldItem == newItem
}
override fun areContentsTheSame(oldItem: Flower, newItem: Flower): Boolean {
return oldItem.id == newItem.id
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant