PreferenceCategory
public
class
PreferenceCategory
extends PreferenceGroup
| java.lang.Object | |||
| ↳ | androidx.preference.Preference | ||
| ↳ | androidx.preference.PreferenceGroup | ||
| ↳ | androidx.preference.PreferenceCategory | ||
A container that is used to group similar Preferences. A PreferenceCategory displays a
category title and visually separates groups of Preferences.
Developer Guides
For information about building a settings screen using the AndroidX Preference library, see Settings.
Summary
Inherited constants |
|---|
Public constructors | |
|---|---|
PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
|
|
PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr)
|
|
PreferenceCategory(Context context, AttributeSet attrs)
|
|
PreferenceCategory(Context context)
|
|
Public methods | |
|---|---|
boolean
|
isEnabled()
Checks whether this preference should be enabled in the list. |
void
|
onBindViewHolder(PreferenceViewHolder holder)
Binds the created View to the data for this preference. |
void
|
onInitializeAccessibilityNodeInfo(AccessibilityNodeInfoCompat info)
Initializes an |
boolean
|
shouldDisableDependents()
Checks whether this preference's dependents should currently be disabled. |
Inherited methods | |
|---|---|
Public constructors
PreferenceCategory
public PreferenceCategory (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
defStyleAttr |
int |
defStyleRes |
int |
PreferenceCategory
public PreferenceCategory (Context context, AttributeSet attrs, int defStyleAttr)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
defStyleAttr |
int |
PreferenceCategory
public PreferenceCategory (Context context, AttributeSet attrs)
| Parameters | |
|---|---|
context |
Context |
attrs |
AttributeSet |
Public methods
isEnabled
public boolean isEnabled ()
Checks whether this preference should be enabled in the list.
| Returns | |
|---|---|
boolean |
true if this preference is enabled, false otherwise
|
onBindViewHolder
public void onBindViewHolder (PreferenceViewHolder holder)
Binds the created View to the data for this preference.
This is a good place to grab references to custom Views in the layout and set properties on them.
Make sure to call through to the superclass's implementation.
| Parameters | |
|---|---|
holder |
PreferenceViewHolder: The ViewHolder that provides references to the views to fill in. These views
will be recycled, so you should not hold a reference to them after this method
returns.
|
onInitializeAccessibilityNodeInfo
public void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfoCompat info)
Initializes an AccessibilityNodeInfo with information
about the View for this preference.
| Parameters | |
|---|---|
info |
AccessibilityNodeInfoCompat |
shouldDisableDependents
public boolean shouldDisableDependents ()
Checks whether this preference's dependents should currently be disabled.
| Returns | |
|---|---|
boolean |
true if the dependents should be disabled, otherwise false
|
Interfaces
- DialogPreference.TargetFragment
- EditTextPreference.OnBindEditTextListener
- Preference.OnPreferenceChangeListener
- Preference.OnPreferenceClickListener
- Preference.SummaryProvider
- PreferenceFragment.OnPreferenceDisplayDialogCallback
- PreferenceFragment.OnPreferenceStartFragmentCallback
- PreferenceFragment.OnPreferenceStartScreenCallback
- PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback
- PreferenceFragmentCompat.OnPreferenceStartFragmentCallback
- PreferenceFragmentCompat.OnPreferenceStartScreenCallback
- PreferenceGroup.PreferencePositionCallback
- PreferenceManager.OnDisplayPreferenceDialogListener
- PreferenceManager.OnNavigateToScreenListener
- PreferenceManager.OnPreferenceTreeClickListener
Classes
- CheckBoxPreference
- DialogPreference
- DropDownPreference
- EditTextPreference
- EditTextPreference.SimpleSummaryProvider
- EditTextPreferenceDialogFragment
- EditTextPreferenceDialogFragmentCompat
- ListPreference
- ListPreference.SimpleSummaryProvider
- ListPreferenceDialogFragment
- ListPreferenceDialogFragmentCompat
- MultiSelectListPreference
- MultiSelectListPreferenceDialogFragment
- MultiSelectListPreferenceDialogFragmentCompat
- Preference
- Preference.BaseSavedState
- PreferenceCategory
- PreferenceDataStore
- PreferenceDialogFragment
- PreferenceDialogFragmentCompat
- PreferenceFragment
- PreferenceFragmentCompat
- PreferenceGroup
- PreferenceManager
- PreferenceManager.PreferenceComparisonCallback
- PreferenceManager.SimplePreferenceComparisonCallback
- PreferenceScreen
- PreferenceViewHolder
- SeekBarPreference
- SwitchPreference
- SwitchPreferenceCompat
- TwoStatePreference