getChangePayload

open fun getChangePayload(item1: T2, item2: T2): Any(source)

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

For example, if you are using Callback 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.

Return

A payload object that represents the changes between the two items.

Parameters

item1

The first item to check.

item2

The second item to check.