public class Preference
extends androidx.preference.Preference
| Constructor and Description |
|---|
Preference(android.content.Context context)
Creates a new material-styled preference.
|
Preference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new material-styled preference.
|
Preference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new material-styled preference.
|
Preference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new material-styled preference.
|
| Modifier and Type | Method and Description |
|---|---|
android.content.res.ColorStateList |
getIconTintList()
Returns the color state list, which is used to tint the preference's icon.
|
android.graphics.PorterDuff.Mode |
getIconTintMode()
Returns the mode, which is used to tint the preference's icon.
|
void |
performClick()
Performs a click on the preference.
|
void |
setIcon(android.graphics.drawable.Drawable icon) |
void |
setIconTint(int color)
Sets the color, which should be used to tint the preference's icon.
|
void |
setIconTintList(android.content.res.ColorStateList tintList)
Sets the color state list, which should be used to tint the preference's icon.
|
void |
setIconTintMode(android.graphics.PorterDuff.Mode mode)
Sets the mode, which should be used to tint the preference's icon.
|
public Preference(android.content.Context context)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic Preference(android.content.Context context,
android.util.AttributeSet attributeSet)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availablepublic Preference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcepublic Preference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullattributeSet - The attributes of the XML tag that is inflating the preference, as an instance of the
type AttributeSet or null, if no attributes are availabledefaultStyle - The default style to apply to this preference. If 0, no style will be applied (beyond
what is included in the theme). This may either be an attribute resource, whose value
will be retrieved from the current theme, or an explicit style resourcedefaultStyleResource - A resource identifier of a style resource that supplies default values for the
preference, used only if the default style is 0 or can not be found in the theme. Can
be 0 to not look for defaultspublic void performClick()
public final android.content.res.ColorStateList getIconTintList()
ColorStateList or null, if no color state list has been setpublic final void setIconTint(int color)
color - The color, which should be set, as an Integer valuepublic final void setIconTintList(android.content.res.ColorStateList tintList)
tintList - The color state list, which should be set, as an instance of the class ColorStateList or null, if no color state list should be setpublic final android.graphics.PorterDuff.Mode getIconTintMode()
PorterDuff.Mode. The mode may not be nullpublic final void setIconTintMode(android.graphics.PorterDuff.Mode mode)
mode - The mode, which should be set, as a value of the enum PorterDuff.Mode. The
mode may not be nullpublic void setIcon(android.graphics.drawable.Drawable icon)