areContentsTheSame

open fun areContentsTheSame(oldItem: T2, newItem: T2): Boolean(source)

Called by the SortedList when it wants to check whether two items have the same data or not. SortedList uses this information to decide whether it should call #onChanged(int, int) or not.

SortedList uses this method to check equality instead of Object#equals(Object) so that you can change its behavior depending on your UI.

For example, if you are using SortedList with a RecyclerView.Adapter, you should return whether the items' visual representations are the same or not.