PreferenceManager.PreferenceComparisonCallback


public abstract class PreferenceManager.PreferenceComparisonCallback

Known direct subclasses
PreferenceManager.SimplePreferenceComparisonCallback

A basic implementation of PreferenceComparisonCallback suitable for use with the default Preference classes.


Callback class to be used by the androidx.recyclerview.widget.RecyclerView.Adapter associated with the PreferenceScreen, used to determine when two Preference objects are semantically and visually the same.

Summary

Public constructors

Public methods

abstract boolean

Called to determine if two Preference objects will display the same data

abstract boolean

Called to determine if two Preference objects represent the same item

Public constructors

PreferenceComparisonCallback

Added in 1.0.0
public PreferenceComparisonCallback()

Public methods

arePreferenceContentsTheSame

Added in 1.0.0
public abstract boolean arePreferenceContentsTheSame(
    @NonNull Preference p1,
    @NonNull Preference p2
)

Called to determine if two Preference objects will display the same data

Parameters
@NonNull Preference p1

Preference object to compare

@NonNull Preference p2

Preference object to compare

Returns
boolean

true if the objects are visually identical

arePreferenceItemsTheSame

Added in 1.0.0
public abstract boolean arePreferenceItemsTheSame(@NonNull Preference p1, @NonNull Preference p2)

Called to determine if two Preference objects represent the same item

Parameters
@NonNull Preference p1

Preference object to compare

@NonNull Preference p2

Preference object to compare

Returns
boolean

true if the objects represent the same item