package

androidx.preference

Overview

The Preference library allows you to build interactive settings screens, without needing to handle interacting with device storage or managing the user interface.

Developer Guides

For information about building a settings screen using the AndroidX Preference library, see Settings.

Interfaces

DialogPreference.TargetFragmentInterface for PreferenceFragmentCompats to implement to allow DialogPreferences to find the preference that launched the dialog.
EditTextPreference.OnBindEditTextListenerInterface definition for a callback to be invoked when the corresponding dialog view for this preference is bound.
Preference.OnPreferenceChangeListenerInterface definition for a callback to be invoked when the value of this Preference has been changed by the user and is about to be set and/or persisted.
Preference.OnPreferenceClickListenerInterface definition for a callback to be invoked when a Preference is clicked.
Preference.SummaryProvider<T>Interface definition for a callback to be invoked when the summary of this Preference is requested (typically when this preference is added to the hierarchy or its value is updated).
PreferenceFragment.OnPreferenceDisplayDialogCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to display a dialog.
PreferenceFragment.OnPreferenceStartFragmentCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to switch to a specified fragment.
PreferenceFragment.OnPreferenceStartScreenCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to switch to a new screen of preferences.
PreferenceFragmentCompat.OnPreferenceDisplayDialogCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to display a dialog.
PreferenceFragmentCompat.OnPreferenceStartFragmentCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to switch to a specified fragment.
PreferenceFragmentCompat.OnPreferenceStartScreenCallbackInterface that the fragment's containing activity should implement to be able to process preference items that wish to switch to a new screen of preferences.
PreferenceGroup.OnExpandButtonClickListenerDefinition for a callback to be invoked when the expand button is clicked.
PreferenceGroup.PreferencePositionCallbackInterface for PreferenceGroup adapters to implement so that PreferenceFragmentCompat.scrollToPreference(String) and PreferenceFragmentCompat.scrollToPreference(Preference) can determine the correct scroll position to request.
PreferenceManager.OnDisplayPreferenceDialogListenerInterface definition for a class that will be called when a Preference requests to display a dialog.
PreferenceManager.OnNavigateToScreenListenerInterface definition for a class that will be called when a PreferenceScreen requests navigation.
PreferenceManager.OnPreferenceTreeClickListenerInterface definition for a callback to be invoked when a Preference in the hierarchy rooted at this PreferenceScreen is clicked.

Classes

AndroidResourcesUtility class for attributes unavailable on older APIs
CheckBoxPreferenceA Preference that provides checkbox widget functionality.
DialogPreferenceA base class for Preferences that are dialog-based.
DropDownPreferenceA ListPreference that presents the options in a drop down menu rather than a dialog.
EditTextPreferenceA DialogPreference that shows a in the dialog.
EditTextPreference.SimpleSummaryProviderA simple Preference.SummaryProvider implementation for an EditTextPreference.
EditTextPreferenceDialogFragment
EditTextPreferenceDialogFragmentCompat
ListPreferenceA Preference that displays a list of entries as a dialog.
ListPreference.SimpleSummaryProviderA simple Preference.SummaryProvider implementation for a ListPreference.
ListPreferenceDialogFragment
ListPreferenceDialogFragmentCompat
MultiSelectListPreferenceA Preference that displays a list of entries as a dialog.
MultiSelectListPreferenceDialogFragment
MultiSelectListPreferenceDialogFragmentCompat
PreferenceThe basic building block that represents an individual setting displayed to a user in the preference hierarchy.
Preference.BaseSavedStateA base class for managing the instance state of a Preference.
PreferenceCategoryA container that is used to group similar Preferences.
PreferenceDataStoreA data store interface to be implemented and provided to the Preference framework.
PreferenceDialogFragmentAbstract base class which presents a dialog associated with a DialogPreference.
PreferenceDialogFragmentCompatAbstract base class which presents a dialog associated with a DialogPreference.
PreferenceFragmentShows a hierarchy of Preference objects as lists.
PreferenceFragmentCompatA PreferenceFragmentCompat is the entry point to using the Preference library.
PreferenceGroupA container for multiple Preferences.
PreferenceGroupAdapterAn adapter that connects a RecyclerView to the Preferences contained in an associated PreferenceGroup.
PreferenceManagerUsed to help create Preference hierarchies from activities or XML.
PreferenceManager.PreferenceComparisonCallbackCallback class to be used by the RecyclerView.Adapter associated with the PreferenceScreen, used to determine when two Preference objects are semantically and visually the same.
PreferenceManager.SimplePreferenceComparisonCallbackA basic implementation of PreferenceManager.PreferenceComparisonCallback suitable for use with the default Preference classes.
PreferenceRecyclerViewAccessibilityDelegateThe accessibility delegate used by the RecyclerView that displays views for Preferences.
PreferenceScreenA top-level container that represents a settings screen.
PreferenceViewHolderA class which caches views associated with the default Preference layouts.
SeekBarPreferencePreference based on android.preference.SeekBarPreference but uses support preference as a base .
SwitchPreferenceA Preference that provides a two-state toggleable option.
SwitchPreferenceCompatA Preference that provides a two-state toggleable option.
TwoStatePreferenceCommon base class for preferences that have two selectable states, save a boolean value, and may have dependent preferences that are enabled/disabled based on the current state.
UnPressableLinearLayoutCustom LinearLayout that does not propagate the pressed state down to its children.