areContentsTheSame
Called by the DiffUtil when it wants to check whether two items have the same data. DiffUtil uses this information to detect if the contents of an item has changed.
DiffUtil uses this method to check equality instead of equals so that you can change its behavior depending on your UI. For example, if you are using DiffUtil with a RecyclerView.Adapter, you should return whether the items' visual representations are the same.
This method is called only if areItemsTheSame returns true
for these items.
Return
True if the contents of the items are the same or false if they are different.
Parameters
oldItemPosition
The position of the item in the old list
newItemPosition
The position of the item in the new list which replaces the oldItem