Skip to content

Instantly share code, notes, and snippets.

@husaynhakeem
Created September 27, 2017 13:55
Show Gist options
  • Save husaynhakeem/f16af0ab99907974be1683fd2a5ed6c9 to your computer and use it in GitHub Desktop.
Save husaynhakeem/f16af0ab99907974be1683fd2a5ed6c9 to your computer and use it in GitHub Desktop.
public static final DiffCallback<Pokemon> DIFF_CALLBACK = new DiffCallback<Pokemon>() {
@Override
public boolean areItemsTheSame(@NonNull Pokemon oldPokemon, @NonNull Pokemon newPokemon) {
return oldPokemon.id == newPokemon.id;
}
@Override
public boolean areContentsTheSame(@NonNull Pokemon oldPokemon, @NonNull Pokemon newPokemon) {
return oldPokemon.name.equals(newPokemon.name);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment