GuidedActionDiffCallback


public class GuidedActionDiffCallback extends DiffCallback


DiffCallback used for GuidedActions, see setActionsDiffCallback.

Summary

Public constructors

Public methods

boolean
areContentsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)

Called to decide whether two items have the same data.

boolean
areItemsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)

Called to decide whether two objects represent the same item.

static @NonNull GuidedActionDiffCallback

Returns the singleton GuidedActionDiffCallback.

Inherited methods

From androidx.leanback.widget.DiffCallback
@Nullable Object
getChangePayload(@NonNull Value oldItem, @NonNull Value newItem)

Called to get a change payload between an old and new version of an item.

Public constructors

GuidedActionDiffCallback

Added in 1.1.0
public GuidedActionDiffCallback()

Public methods

areContentsTheSame

Added in 1.1.0
public boolean areContentsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)

Called to decide whether two items have the same data. This information is used to detect if the contents of an item have changed.

Parameters
@NonNull GuidedAction oldItem

The item in the old list.

@NonNull GuidedAction newItem

The item in the new list.

Returns
boolean

True if the contents of the items are the same or false if they are different.

areItemsTheSame

Added in 1.1.0
public boolean areItemsTheSame(
    @NonNull GuidedAction oldItem,
    @NonNull GuidedAction newItem
)

Called to decide whether two objects represent the same item.

Parameters
@NonNull GuidedAction oldItem

The item in the old list.

@NonNull GuidedAction newItem

The item in the new list.

Returns
boolean

True if the two items represent the same object or false if they are different.

See also
areItemsTheSame

getInstance

Added in 1.1.0
public static @NonNull GuidedActionDiffCallback getInstance()

Returns the singleton GuidedActionDiffCallback.

Returns
@NonNull GuidedActionDiffCallback

The singleton GuidedActionDiffCallback.