getChangePayload

open fun getChangePayload(@NonNull oldItem: T, @NonNull newItem: T): Any(source)

When areItemsTheSame returns true for two items and areContentsTheSame returns false for them, this method is called to get a payload about the change.

For example, if you are using DiffUtil with RecyclerView, you can return the particular field that changed in the item and your ItemAnimator can use that information to run the correct animation.

Default implementation returns null.

See also