public class NavigationPreference
extends Preference
PreferenceActivity when clicked.| Modifier and Type | Class and Description |
|---|---|
static interface |
NavigationPreference.Callback
Defines the callback, a class, which should be notified, when the fragment, which is
associated with a navigation preference, should be shown, must implement.
|
static class |
NavigationPreference.SavedState
A data structure, which allows to save the internal state of a
NavigationPreference. |
| Constructor and Description |
|---|
NavigationPreference(android.content.Context context)
Creates a new preference, which allows to show a preference screen within a
PreferenceActivity when clicked. |
NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which allows to show a preference screen within a
PreferenceActivity when clicked. |
NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which allows to show a preference screen within a
PreferenceActivity when clicked. |
NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which allows to show a preference screen within a
PreferenceActivity when clicked. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.CharSequence |
getBreadCrumbTitle()
Returns the breadcrumb title, which is shown, when showing the fragment, which is associated
with the preference.
|
android.os.Bundle |
getExtras()
Returns the arguments, which are passed to the fragment, which is associated with the
preference.
|
java.lang.String |
getFragment()
Returns the fully classified class name of the fragment, which is associated with the
preference.
|
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.
|
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
void |
performClick()
Performs a click on the preference.
|
void |
setBreadCrumbTitle(java.lang.CharSequence breadCrumbTitle)
Sets the breadcrumb title, which should be shown, when showing the fragment, which is
associated with the preference.
|
void |
setBreadCrumbTitle(int resourceId)
Sets the breadcrumb title, which should be shown, when showing the fragment, which is
associated with the preference.
|
void |
setCallback(NavigationPreference.Callback callback)
Sets the callback, which should be notified, when the fragment, which is associated with the
preference, should be shown.
|
void |
setExtras(android.os.Bundle extras)
Sets the argument, which should be passed to the fragment, which is associated with the
preference.
|
void |
setFragment(java.lang.String fragment)
Sets the fully classified class name of the fragment, which should be associated with 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 tintMode)
Sets the mode, which should be used to tint the preference's icon.
|
void |
setOnPreferenceClickListener(OnPreferenceClickListener listener) |
public NavigationPreference(android.content.Context context)
PreferenceActivity when clicked.context - The context, which should be used by the preference, as an instance of the class
Context. The context may not be nullpublic NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
PreferenceActivity when clicked.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 NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
PreferenceActivity when clicked.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 NavigationPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
PreferenceActivity when clicked.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 final void setCallback(NavigationPreference.Callback callback)
callback - The callback, which should be set, as an instance of the type NavigationPreference.Callback or
null, if no callback should be notifiedpublic final java.lang.CharSequence getBreadCrumbTitle()
CharSequence or null, if no
breadcrumb title is availablepublic final void setBreadCrumbTitle(int resourceId)
resourceId - The resource id of the breadcrumb title, which should be set, as an Integer
value. The resource id must correspond to a valid string resourcepublic final void setBreadCrumbTitle(java.lang.CharSequence breadCrumbTitle)
breadCrumbTitle - The breadcrumb title, which should be set, as an instance of the type CharSequence or null, if no breadcrumb title should be setpublic final java.lang.String getFragment()
String or null, if no fragment is associated with the preferencepublic final void setFragment(java.lang.String fragment)
fragment - The fully classified class name of the fragment, which should be set, as a String or null, if no fragment should be setpublic final android.os.Bundle getExtras()
Bundle or null, if no arguments are passed to
the fragmentpublic final void setExtras(android.os.Bundle extras)
extras - The arguments, which should be set, as an instance of the class Bundle or
null, if no arguments should be passed to the fragmentpublic 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 tintMode)
tintMode - 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)
public final void setOnPreferenceClickListener(OnPreferenceClickListener listener)
public final void performClick()
protected final android.os.Parcelable onSaveInstanceState()
protected final void onRestoreInstanceState(android.os.Parcelable state)