Stay organized with collections Save and categorize content based on your preferences.

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 GuidedActionDiffCallback

Returns the singleton GuidedActionDiffCallback.

Inherited methods

From androidx.leanback.widget.DiffCallback
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

public GuidedActionDiffCallback()

Public methods

areContentsTheSame

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

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

public static GuidedActionDiffCallback getInstance()

Returns the singleton GuidedActionDiffCallback.

Returns
GuidedActionDiffCallback

The singleton GuidedActionDiffCallback.