public final class R.attr


Summary

Public fields

static int

Attribute indicating whether the slider within this preference can be adjusted, that is pressing left/right keys when this preference is focused will move the slider accordingly (e.g. inline adjustable preferences).

static int

Whether the preference allows displaying divider on top

static int

Whether a divider is allowed to draw after the last item

static int

Whether the preference allows displaying divider below it

static int

Default style for CheckBoxPreference.

static int

The default value for the preference, which will be set either if persistence is off or persistence is on and the preference is not found in the persistent storage.

static int

The key of another Preference that this Preference will depend on.

static int

The icon for the dialog.

static int

A layout to be used as the content View for the dialog.

static int

The message in the dialog.

static int

Default style for DialogPreference.

static int

The title in the dialog.

static int

The state (true for on, or false for off) that causes dependents to be disabled.

static int

Default style for DropDownPreference.

static int

Default style for EditTextPreference.

static int

Whether the Preference is enabled.

static int

The human-readable array to present as a list.

static int

The array to find the value to save for a preference when an entry from entries is selected.

static int

When used inside of a modern PreferenceActivity, this declares a new PreferenceFragment to be shown when the user selects this item.

static int
static int

Whether the space for the preference icon view will be reserved.

static int

The key to store the Preference value.

static int
static int

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

static int

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp".

static int

May be an integer value, such as "100".

static int

The negative button text for the dialog.

static int

The order for the Preference (lower values are to be ordered first).

static int

Whether to order the Preference under this group as they appear in the XML file.

static int

Whether the Preference stores its value to the shared preferences.

static int

The positive button text for the dialog.

static int

Default style for PreferenceCategory.

static int

The preferred TextAppearance for the title displayed in a PreferenceCategory.

static int

The preferred color for the title displayed in a PreferenceCategory.

static int

Default style for Headers pane in PreferenceActivity.

static int

Preference fragment list style

static int

Default style for Headers pane in PreferenceActivity.

static int

Default style for informational Preference.

static int

Default style for PreferenceScreen.

static int

Default style for Preference.

static int

Theme for inflating Preference objects

static int

Attribute controlling the amount to increment or decrement the seekbar when the user presses the arrow keys

static int

Default style for seekbar preferences.

static int

Whether the Preference is selectable.

static int
static int

Whether the view of this Preference should be disabled when this Preference is disabled.

static int

Flag indicating whether the TextView next to the seekbar that shows the current seekbar value will be displayed.

static int

Whether to use single line for the preference title text.

static int

The summary for the Preference in a PreferenceActivity screen.

static int

The summary for the Preference in a PreferenceActivity screen when the CheckBoxPreference is unchecked.

static int

The summary for the Preference in a PreferenceActivity screen when the CheckBoxPreference is checked.

static int

Default style for switch compat preferences.

static int

Default style for switch preferences.

static int

The text used on the switch itself when in the "off" state.

static int

The text used on the switch itself when in the "on" state.

static int
static int

The layout for the controllable widget portion of a Preference.

Public constructors

Public fields

adjustable

public static int adjustable

Attribute indicating whether the slider within this preference can be adjusted, that is pressing left/right keys when this preference is focused will move the slider accordingly (e.g. inline adjustable preferences). False, if the slider within the preference is read-only and cannot be adjusted. By default, the seekbar is adjustable.

May be a boolean value, such as "true" or "false".

allowDividerAbove

public static int allowDividerAbove

Whether the preference allows displaying divider on top

May be a boolean value, such as "true" or "false".

allowDividerAfterLastItem

public static int allowDividerAfterLastItem

Whether a divider is allowed to draw after the last item

May be a boolean value, such as "true" or "false".

allowDividerBelow

public static int allowDividerBelow

Whether the preference allows displaying divider below it

May be a boolean value, such as "true" or "false".

checkBoxPreferenceStyle

public static int checkBoxPreferenceStyle

Default style for CheckBoxPreference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

defaultValue

public static int defaultValue

The default value for the preference, which will be set either if persistence is off or persistence is on and the preference is not found in the persistent storage.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

May be an integer value, such as "100".

May be a boolean value, such as "true" or "false".

May be a floating point value, such as "1.2".

dependency

public static int dependency

The key of another Preference that this Preference will depend on. If the other Preference is not set or is off, this Preference will be disabled.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

dialogIcon

public static int dialogIcon

The icon for the dialog.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

dialogLayout

public static int dialogLayout

A layout to be used as the content View for the dialog. By default, this shouldn't be needed. If a custom DialogPreference is required, this should be set. For example, the EditTextPreference uses a layout with an EditText as this attribute.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

dialogMessage

public static int dialogMessage

The message in the dialog. If a dialogLayout is provided and contains a TextView with ID android:id/message, this message will be placed in there.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

dialogPreferenceStyle

public static int dialogPreferenceStyle

Default style for DialogPreference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

dialogTitle

public static int dialogTitle

The title in the dialog.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

disableDependentsState

public static int disableDependentsState

The state (true for on, or false for off) that causes dependents to be disabled. By default, dependents will be disabled when this is unchecked, so the value of this preference is false.

May be a boolean value, such as "true" or "false".

public static int dropdownPreferenceStyle

Default style for DropDownPreference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

editTextPreferenceStyle

public static int editTextPreferenceStyle

Default style for EditTextPreference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

enabled

public static int enabled

Whether the Preference is enabled.

May be a boolean value, such as "true" or "false".

entries

public static int entries

The human-readable array to present as a list. Each entry must have a corresponding index in entryValues.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

entryValues

public static int entryValues

The array to find the value to save for a preference when an entry from entries is selected. If a user clicks on the second item in entries, the second item in this array will be saved to the preference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

fragment

public static int fragment

When used inside of a modern PreferenceActivity, this declares a new PreferenceFragment to be shown when the user selects this item.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

icon

public static int icon

iconSpaceReserved

public static int iconSpaceReserved

Whether the space for the preference icon view will be reserved. If set to true, the preference will be offset as if it would have the icon and thus aligned with other preferences having icons. By default, preference icon view visibility will be set to GONE when there is no icon provided, so the default value of this attribute is false.

May be a boolean value, such as "true" or "false".

key

public static int key

The key to store the Preference value.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

layout

public static int layout

maxHeight

public static int maxHeight

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

maxWidth

public static int maxWidth

May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters).

min

public static int min

May be an integer value, such as "100".

negativeButtonText

public static int negativeButtonText

The negative button text for the dialog. Set to @null to hide the negative button.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

order

public static int order

The order for the Preference (lower values are to be ordered first). If this is not specified, the default ordering will be alphabetic.

May be an integer value, such as "100".

orderingFromXml

public static int orderingFromXml

Whether to order the Preference under this group as they appear in the XML file. If this is false, the ordering will follow the Preference order attribute and default to alphabetic for those without the order attribute.

May be a boolean value, such as "true" or "false".

persistent

public static int persistent

Whether the Preference stores its value to the shared preferences.

May be a boolean value, such as "true" or "false".

positiveButtonText

public static int positiveButtonText

The positive button text for the dialog. Set to @null to hide the positive button.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

preferenceCategoryStyle

public static int preferenceCategoryStyle

Default style for PreferenceCategory.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceCategoryTitleTextAppearance

public static int preferenceCategoryTitleTextAppearance

The preferred TextAppearance for the title displayed in a PreferenceCategory. This is needed as there are no relevant android: attributes we can use for this as we do with other text appearance styles.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceCategoryTitleTextColor

public static int preferenceCategoryTitleTextColor

The preferred color for the title displayed in a PreferenceCategory. If this is not specified by a developer, we use ?android:attr/colorAccent above Lollipop, and ?attr/colorAccent below Lollipop (when using an AppCompat theme).

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb".

preferenceFragmentCompatStyle

public static int preferenceFragmentCompatStyle

Default style for Headers pane in PreferenceActivity.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceFragmentListStyle

public static int preferenceFragmentListStyle

Preference fragment list style

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceFragmentStyle

public static int preferenceFragmentStyle

Default style for Headers pane in PreferenceActivity.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceInformationStyle

public static int preferenceInformationStyle

Default style for informational Preference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceScreenStyle

public static int preferenceScreenStyle

Default style for PreferenceScreen.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceStyle

public static int preferenceStyle

Default style for Preference.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

preferenceTheme

public static int preferenceTheme

Theme for inflating Preference objects

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

seekBarIncrement

public static int seekBarIncrement

Attribute controlling the amount to increment or decrement the seekbar when the user presses the arrow keys

May be an integer value, such as "100".

seekBarPreferenceStyle

public static int seekBarPreferenceStyle

Default style for seekbar preferences.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

selectable

public static int selectable

Whether the Preference is selectable.

May be a boolean value, such as "true" or "false".

selectableItemBackground

public static int selectableItemBackground

shouldDisableView

public static int shouldDisableView

Whether the view of this Preference should be disabled when this Preference is disabled.

May be a boolean value, such as "true" or "false".

showSeekBarValue

public static int showSeekBarValue

Flag indicating whether the TextView next to the seekbar that shows the current seekbar value will be displayed. If true, the view is VISIBLE; if false, the view will be GONE. By default, this view is GONE.

May be a boolean value, such as "true" or "false".

singleLineTitle

public static int singleLineTitle

Whether to use single line for the preference title text. By default, preference title will be constrained to one line, so the default value of this attribute is true.

May be a boolean value, such as "true" or "false".

summary

public static int summary

The summary for the Preference in a PreferenceActivity screen.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

summaryOff

public static int summaryOff

The summary for the Preference in a PreferenceActivity screen when the CheckBoxPreference is unchecked. If separate on/off summaries are not needed, the summary attribute can be used instead.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

summaryOn

public static int summaryOn

The summary for the Preference in a PreferenceActivity screen when the CheckBoxPreference is checked. If separate on/off summaries are not needed, the summary attribute can be used instead.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

switchPreferenceCompatStyle

public static int switchPreferenceCompatStyle

Default style for switch compat preferences.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

switchPreferenceStyle

public static int switchPreferenceStyle

Default style for switch preferences.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

switchTextOff

public static int switchTextOff

The text used on the switch itself when in the "off" state. This should be a very SHORT string, as it appears in a small space.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

switchTextOn

public static int switchTextOn

The text used on the switch itself when in the "on" state. This should be a very SHORT string, as it appears in a small space.

May be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character;

title

public static int title

widgetLayout

public static int widgetLayout

The layout for the controllable widget portion of a Preference. This is inflated into the layout for a Preference and should be used more frequently than the layout attribute. For example, a checkbox preference would specify a custom layout (consisting of just the CheckBox) here.

May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name".

Public constructors

attr

public attr()