DiffResult

open class DiffResult(source)

This class holds the information about the result of a calculateDiff call.

You can consume the updates in a DiffResult via dispatchUpdatesTo or directly stream the results into a RecyclerView.Adapter via dispatchUpdatesTo.

Properties

Link copied to clipboard
val NO_POSITION: Int = -1
Signifies an item not present in the list.

Functions

Link copied to clipboard
open fun convertNewPositionToOld(@IntRange(from = 0) newListPosition: Int): Int
Given a position in the new list, returns the position in the old list, or NO_POSITION if it was removed.
Link copied to clipboard
open fun convertOldPositionToNew(@IntRange(from = 0) oldListPosition: Int): Int
Given a position in the old list, returns the position in the new list, or NO_POSITION if it was removed.
Link copied to clipboard
open fun dispatchUpdatesTo(@NonNull updateCallback: ListUpdateCallback)
Dispatches update operations to the given Callback.
Dispatches the update events to the given adapter.