PreferenceGroup.PreferencePositionCallback

public static interface PreferenceGroup.PreferencePositionCallback

androidx.preference.PreferenceGroup.PreferencePositionCallback


Interface for PreferenceGroup adapters to implement so that PreferenceFragmentCompat.scrollToPreference(String) and PreferenceFragmentCompat.scrollToPreference(Preference) can determine the correct scroll position to request.

Summary

Public methods

abstract int getPreferenceAdapterPosition(Preference preference)

Returns the adapter position of the specified Preference object

abstract int getPreferenceAdapterPosition(String key)

Returns the adapter position of the first Preference with the specified key.

Public methods

getPreferenceAdapterPosition

public abstract int getPreferenceAdapterPosition (Preference preference)

Returns the adapter position of the specified Preference object

Parameters
preference Preference: Preference object to find

Returns
int Adapter position of the Preference or RecyclerView.NO_POSITION if not found

getPreferenceAdapterPosition

public abstract int getPreferenceAdapterPosition (String key)

Returns the adapter position of the first Preference with the specified key.

Parameters
key String: Key of Preference to find

Returns
int Adapter position of the Preference or RecyclerView.NO_POSITION if not found