added in version 1.0.0
belongs to Maven artifact androidx.preference:preference:1.0.0-beta01

PreferenceCategory

public class PreferenceCategory
extends PreferenceGroup

java.lang.Object
   ↳ androidx.preference.Preference
     ↳ androidx.preference.PreferenceGroup
       ↳ androidx.preference.PreferenceCategory


Used to group Preference objects and provide a disabled title above the group.

Developer Guides

For information about building a settings UI with Preferences, read the Settings guide.

Summary

Inherited XML attributes

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 AccessibilityNodeInfo with information about the View for this Preference.

boolean shouldDisableDependents()

Checks whether this preference's dependents should currently be disabled.

Inherited methods

Public constructors

PreferenceCategory

added in version 1.0.0
public PreferenceCategory (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

PreferenceCategory

added in version 1.0.0
public PreferenceCategory (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

PreferenceCategory

added in version 1.0.0
public PreferenceCategory (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

PreferenceCategory

added in version 1.0.0
public PreferenceCategory (Context context)

Parameters
context Context

Public methods

isEnabled

added in version 1.0.0
public boolean isEnabled ()

Checks whether this Preference should be enabled in the list.

Returns
boolean True if this Preference is enabled, false otherwise.

onBindViewHolder

added in version 1.0.0
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

added in version 1.0.0
public void onInitializeAccessibilityNodeInfo (AccessibilityNodeInfoCompat info)

Initializes an AccessibilityNodeInfo with information about the View for this Preference.

Parameters
info AccessibilityNodeInfoCompat

shouldDisableDependents

added in version 1.0.0
public boolean shouldDisableDependents ()

Checks whether this preference's dependents should currently be disabled.

Returns
boolean True if the dependents should be disabled, otherwise false.