public class DialogPreference extends Preference implements android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnShowListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnKeyListener
| Modifier and Type | Class and Description |
|---|---|
static class |
DialogPreference.SavedState
A data structure, which allows to save the internal state of an
DialogPreference. |
| Constructor and Description |
|---|
DialogPreference(android.content.Context context)
Creates a new preference, which will show a dialog when clicked by the user.
|
DialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new preference, which will show a dialog when clicked by the user.
|
DialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new preference, which will show a dialog when clicked by the user.
|
DialogPreference(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new preference, which will show a dialog when clicked by the user.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areDialogDividersShownOnScroll()
Returns, whether the dividers, which are located above and below the list view of the
preference's dialog, are shown when the list view is scrolled, or not.
|
protected AbstractButtonBarDialog |
createDialog(<any> dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
protected <any> |
createDialogBuilder(int dialogTheme)
The method, which is invoked on subclasses when the builder, which is used to configure the
preference's dialog, is about to be created.
|
android.app.Dialog |
getDialog()
Returns the dialog, which is shown by the preference.
|
android.graphics.drawable.Drawable |
getDialogBackground()
Returns the background of the preference's dialog.
|
int |
getDialogBottomMargin()
Returns the bottom margin of the preference's dialog.
|
android.content.res.ColorStateList |
getDialogButtonTextColor()
Returns the text color of the buttons of the preference's dialog.
|
android.graphics.Typeface |
getDialogButtonTypeface()
Returns the typeface of the buttons of the preference's dialog.
|
DialogAnimation |
getDialogCancelAnimation()
Returns the animation, which is used to cancel the preference's dialog.
|
DialogAnimation |
getDialogDismissAnimation()
Returns the animation, which is used to dismiss the preference's dialog.
|
int |
getDialogDividerColor()
Returns the color of dividers, which are contained by the preference's dialog.
|
int |
getDialogDividerMargin()
Returns the left and right margin of dividers, which are contained by the preference's
dialog.
|
int |
getDialogGravity()
Returns the gravity of the preference's dialog.
|
android.graphics.drawable.Drawable |
getDialogHeaderBackground()
Returns the background of the header of the preference's dialog.
|
android.graphics.drawable.Drawable |
getDialogHeaderIcon()
Returns the icon of the header of the preference's dialog.
|
android.content.res.ColorStateList |
getDialogHeaderIconTintList()
Returns the color state list, which is used to tint the icon of the header of the
preference's dialog.
|
android.graphics.PorterDuff.Mode |
getDialogHeaderIconTintMode()
Returns the mode, which is used to tint the icon of the header of the preference's dialog.
|
int |
getDialogHeight()
Returns the height of the preference's dialog.
|
android.graphics.drawable.Drawable |
getDialogIcon()
Returns the icon of the preference's dialog.
|
android.content.res.ColorStateList |
getDialogIconTintList()
Returns the color state list, which is used to tint the icon of the preference's dialog.
|
android.graphics.PorterDuff.Mode |
getDialogIconTintMode()
Returns the mode, which is used to tint the icon of the preference's dialog.
|
int |
getDialogLeftMargin()
Returns the left margin of the preference's dialog.
|
int |
getDialogMaxHeight()
Returns the maximum height of the preference's dialog.
|
int |
getDialogMaxWidth()
Returns the maximum width of the preference's dialog.
|
java.lang.CharSequence |
getDialogMessage()
Returns the message of the preference's dialog.
|
int |
getDialogMessageColor()
Returns the color of the message of the preference's dialog.
|
android.graphics.Typeface |
getDialogMessageTypeface()
Returns the typeface of the message of the preference's dialog.
|
int |
getDialogPaddingBottom()
Returns the bottom padding of the preference's dialog.
|
int |
getDialogPaddingLeft()
Returns the left padding of the preference's dialog.
|
int |
getDialogPaddingRight()
Returns the right padding of the preference's dialog.
|
int |
getDialogPaddingTop()
Returns the top padding of the preference's dialog.
|
int |
getDialogRightMargin()
Returns the right margin of the preference's dialog.
|
ScrollableArea |
getDialogScrollableArea()
Returns the scrollable area of the preference's dialog.
|
DialogAnimation |
getDialogShowAnimation()
Returns the animation, which is used to show the preference's dialog.
|
java.lang.CharSequence |
getDialogTitle()
Returns the title of the preference's dialog.
|
int |
getDialogTitleColor()
Returns the color of the title of the preference's dialog.
|
android.graphics.Typeface |
getDialogTitleTypeface()
Returns the typeface of the title of the preference's dialog.
|
int |
getDialogTopMargin()
Returns the top margin of the preference's dialog.
|
int |
getDialogWidth()
Returns the width of the preference's dialog.
|
android.graphics.drawable.Drawable |
getDialogWindowBackground()
Returns the window background of the preference's dialog.
|
java.lang.CharSequence |
getNegativeButtonText()
Returns the text of the negative button of the preference's dialog.
|
java.lang.CharSequence |
getPositiveButtonText()
Returns the text of the positive button of the preference's dialog.
|
boolean |
isDialogButtonBarDividerShown()
Returns, whether the divider, which is located above the buttons of the preference's dialog,
is shown, or not.
|
boolean |
isDialogFitsSystemWindowsBottom()
Returns, whether the preference's dialog accounts for system screen decorations such as the
status bar and insets its content at the bottom edge.
|
boolean |
isDialogFitsSystemWindowsLeft()
Returns, whether the preference's dialog accounts for system screen decorations such as the
status bar and insets its content at the left edge.
|
boolean |
isDialogFitsSystemWindowsRight()
Returns, whether the preference's dialog accounts for system screen decorations such as the
status bar and insets its content at the right edge.
|
boolean |
isDialogFitsSystemWindowsTop()
Returns, whether the preference's dialog accounts for system screen decorations such as the
status bar and insets its content at the top edge.
|
boolean |
isDialogFullscreen()
Returns, whether the preference's dialog is shown fullscreen, or not.
|
boolean |
isDialogHeaderShown()
Returns, whether the header of the preference's dialog is shown, or not.
|
boolean |
isDialogShown()
Returns, whether the preference's dialog is currently shown, or not.
|
boolean |
isValueShownAsSummary()
Returns, whether the currently persisted value is shown instead of the summary, or not.
|
protected boolean |
needInputMethod()
The method, which is invoked on subclasses to determine, whether the soft input mode should
be requested when the preference's dialog becomes shown, or not.
|
void |
onCancel(android.content.DialogInterface dialog) |
protected void |
onClick() |
void |
onClick(android.content.DialogInterface dialog,
int which) |
protected void |
onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
The method, which is invoked on subclasses when the preference's dialog has been closed.
|
void |
onDismiss(android.content.DialogInterface dialog) |
boolean |
onKey(android.content.DialogInterface dialog,
int keyCode,
android.view.KeyEvent event) |
protected void |
onPrepareDialog(<any> dialogBuilder)
The method, which is invoked on subclasses when the preference's dialog is about to be
created.
|
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
void |
onShow(android.content.DialogInterface dialog) |
void |
performClick()
Performs a click on the preference.
|
void |
setCustomDialogButtonBar(int resourceId)
Sets the custom view, which should be used to show the buttons of the preference's dialog.
|
void |
setCustomDialogButtonBar(android.view.View view)
Sets the custom view, which should be used to show the buttons of the preference's dialog.
|
void |
setCustomDialogHeader(int resourceId)
Sets the custom view, which should be used to show the header of the preference's dialog.
|
void |
setCustomDialogHeader(android.view.View view)
Sets the custom view, which should be used to show the header of the preference's dialog.
|
void |
setCustomDialogMessage(int resourceId)
Sets the custom view, which should be used to show the message of the preference's dialog.
|
void |
setCustomDialogMessage(android.view.View view)
Sets the custom view, which should be used to show the message of the preference's dialog.
|
void |
setCustomDialogTitle(int resourceId)
Sets the custom view, which should be used to show the title of the preference's dialog.
|
void |
setCustomDialogTitle(android.view.View view)
Sets the custom view, which should be used to show the title of the preference's dialog.
|
void |
setDialogBackground(android.graphics.Bitmap background)
Sets the background of the preference's dialog.
|
void |
setDialogBackground(int resourceId)
Sets the background of the preference's dialog.
|
void |
setDialogBackgroundColor(int color)
Sets the background color of the preference's dialog.
|
void |
setDialogButtonTextColor(android.content.res.ColorStateList colorStateList)
Sets the text color of the buttons of the preference's dialog.
|
void |
setDialogButtonTextColor(int color)
Sets the text color of the buttons of the preference's dialog.
|
void |
setDialogButtonTypeface(android.graphics.Typeface typeface)
Sets the typeface of the buttons of the preference's dialog.
|
void |
setDialogCancelAnimation(DialogAnimation animation)
Sets the animation, which should be used to cancel the preference's dialog.
|
void |
setDialogDismissAnimation(DialogAnimation animation)
Sets the animation, which should be used to dismiss the preference's dialog.
|
void |
setDialogDividerColor(int color)
Sets the color of dividers, which are contained by the preference's dialog.
|
void |
setDialogDividerMargin(int margin)
Sets the left and right margin of divider, which are contained by the preference's dialog.
|
void |
setDialogFitsSystemWindows(boolean fitsSystemWindows)
Sets, whether the preference's dialog should account for system screen decorations such as
the status bar and inset its content, or not.
|
void |
setDialogFitsSystemWindows(boolean left,
boolean top,
boolean right,
boolean bottom)
Sets, whether the preference's dialog should account for system screen decorations such as
the status bar and inset its content, or not.
|
void |
setDialogFullscreen(boolean fullscreen)
Sets, whether the preference's dialog should be shown fullscreen, or not.
|
void |
setDialogGravity(int gravity)
Sets the gravity of the preference's dialog.
|
void |
setDialogHeaderBackground(android.graphics.Bitmap background)
Sets the background of the header of the preference's dialog.
|
void |
setDialogHeaderBackground(int resourceId)
Sets the background of the header of the preference's dialog.
|
void |
setDialogHeaderBackgroundColor(int color)
Sets the background color of the header of the preference's dialog.
|
void |
setDialogHeaderIcon(android.graphics.Bitmap icon)
Sets the icon of the header of the preference's dialog.
|
void |
setDialogHeaderIcon(int resourceId)
Sets the icon of the header of the preference's dialog.
|
void |
setDialogHeaderIconTint(int color)
Sets the color, which should be used to tint the icon of the header of the preference's
dialog.
|
void |
setDialogHeaderIconTintList(android.content.res.ColorStateList tintList)
Sets the color state list, which should be used to tint the icon of the header of the
preference's dialog.
|
void |
setDialogHeaderIconTintMode(android.graphics.PorterDuff.Mode mode)
Sets the mode, which should be used to tint the icon of the header of the preference's
dialog.
|
void |
setDialogHeight(int height)
Sets the height of the preference's dialog.
|
void |
setDialogIcon(android.graphics.Bitmap dialogIcon)
Sets the icon of the preference's dialog.
|
void |
setDialogIcon(int resourceId)
Sets the icon of the preference's dialog.
|
void |
setDialogIconTint(int color)
Sets the color, which should be used to tint the icon of the preference's dialog.
|
void |
setDialogIconTintList(android.content.res.ColorStateList tintList)
Sets the color state list, which should be used to tint the icon of the preference's dialog.
|
void |
setDialogIconTintMode(android.graphics.PorterDuff.Mode mode)
Sets the mode, which should be used to tint the icon of the preference's dialog.
|
void |
setDialogMargin(int left,
int top,
int right,
int bottom)
Sets the margin of the preference's dialog.
|
void |
setDialogMaxHeight(int maxHeight)
Sets the maximum height of the preference's dialog.
|
void |
setDialogMaxWidth(int maxWidth)
Sets the maximum width of the preference's dialog.
|
void |
setDialogMessage(java.lang.CharSequence dialogMessage)
Sets the message of the preference's dialog.
|
void |
setDialogMessage(int resourceId)
Sets the message of the preference's dialog.
|
void |
setDialogMessageColor(int color)
Sets the color of the message of the preference's dialog.
|
void |
setDialogMessageTypeface(android.graphics.Typeface typeface)
Sets the typeface of the message of the preference's dialog.
|
void |
setDialogPadding(int left,
int top,
int right,
int bottom)
Sets the padding of the preference's dialog.
|
void |
setDialogScrollableArea(Area area)
Sets the scrollable area of the preference's dialog.
|
void |
setDialogScrollableArea(Area top,
Area bottom)
Sets the scrollable area of the preference's dialog.
|
void |
setDialogShowAnimation(DialogAnimation animation)
Sets the animation, which should be used to show the preference's dialog.
|
void |
setDialogTitle(java.lang.CharSequence dialogTitle)
Sets the title of the preference's dialog.
|
void |
setDialogTitle(int resourceId)
Sets the title of the preference's dialog.
|
void |
setDialogTitleColor(int color)
Sets the color of the title of the preference's dialog.
|
void |
setDialogTitleTypeface(android.graphics.Typeface typeface)
Sets the typeface of the title of the preference's dialog.
|
void |
setDialogWidth(int width)
Sets the width of the preference's dialog.
|
void |
setDialogWindowBackground(android.graphics.Bitmap windowBackground)
Sets the window background of the preference's dialog.
|
void |
setDialogWindowBackground(int resourceId)
Sets the window background of the preference's dialog.
|
void |
setNegativeButtonText(java.lang.CharSequence negativeButtonText)
Sets the text of the negative button of the preference's dialog.
|
void |
setNegativeButtonText(int resourceId)
Sets the text of the negative button of the preference's dialog.
|
void |
setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
Sets the listener, which should be notified, when the preference's dialog has been canceled.
|
void |
setOnClickListener(android.content.DialogInterface.OnClickListener listener)
Sets the listener, which should be notified, when a button of the preference's dialog has
been clicked.
|
void |
setOnDismissListener(android.content.DialogInterface.OnDismissListener listener)
Sets the listener, which should be notified, when the preference's dialog has been
dismissed.
|
void |
setOnKeyListener(android.content.DialogInterface.OnKeyListener listener)
Sets the listener, which should be notified, when a key has been dispatched to the
preference's dialog.
|
void |
setOnShowListener(android.content.DialogInterface.OnShowListener listener)
Sets the listener, which should be notified, when the preference's dialog has been shown.
|
void |
setPositiveButtonText(java.lang.CharSequence positiveButtonText)
Sets the text of the positive button of the preference's dialog.
|
void |
setPositiveButtonText(int resourceId)
Sets the text of the positive button of the preference's dialog.
|
void |
showDialogButtonBarDivider(boolean show)
Sets, whether the divider, which is located above the buttons of the preference's dialog,
should be shown, or not.
|
void |
showDialogDividersOnScroll(boolean show)
Sets, whether the dividers, which are located above and below the list view of the
preference's dialog, should be shown when the list view is scrolled, or not.
|
void |
showDialogHeader(boolean show)
Sets, whether the header of the preference's dialog should be shown, or not.
|
void |
showValueAsSummary(boolean showValueAsSummary)
Sets, whether the currently persisted value should be shown instead of the summary, or not.
|
getIconTintList, getIconTintMode, setIcon, setIconTint, setIconTintList, setIconTintModepublic DialogPreference(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 DialogPreference(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 DialogPreference(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 DialogPreference(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 defaultsprotected <any> createDialogBuilder(int dialogTheme)
dialogTheme - The resource id of the theme, which should be used by the dialog, as an Integer valueprotected AbstractButtonBarDialog createDialog(<any> dialogBuilder)
dialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class AbstractMaterialDialogBuilderprotected boolean needInputMethod()
protected void onPrepareDialog(<any> dialogBuilder)
dialogBuilder - The builder, which is used to create the preference's dialog, as an instance of the
class AbstractMaterialDialogBuilderprotected void onDialogClosed(AbstractButtonBarDialog dialog,
boolean positiveResult)
dialog - The dialog, which has been closed, as an instance of the class
AbstractButtonBarDialog. The dialog may not be nullpositiveResult - True, if the dialog has been close affirmatively, false otherwisepublic final android.app.Dialog getDialog()
Dialog or null, if the dialog is currently not shownpublic final boolean isDialogShown()
public final boolean isDialogFullscreen()
public final void setDialogFullscreen(boolean fullscreen)
fullscreen - True, if the preference's dialog should be shown fullscreen, false otherwisepublic final int getDialogGravity()
Integer value or -1, if the
default gravity is used. The gravity consists of the flags given in
Dialog.Gravitypublic final void setDialogGravity(int gravity)
gravity - The gravity, which should be set, as an Integer value or -1, if the default
gravity should be used. The gravity must consist of the flags given in
Dialog.Gravitypublic final int getDialogWidth()
Integer value or
Dialog#MATCH_PARENT, respectively Dialog#WRAP_CONTENT or 0, if the
default width is usedpublic final void setDialogWidth(int width)
width - The width, which should be set, in pixels as an Integer value or
Dialog#MATCH_PARENT, respectively Dialog#WRAP_CONTENT or
0, if the default width should be usedpublic final int getDialogHeight()
Integer value or
Dialog#MATCH_PARENT, respectively Dialog#WRAP_CONTENT or 0, if the
default height is usedpublic final void setDialogHeight(int height)
height - The height, which should be set, in pixels as an Integer value or
Dialog#MATCH_PARENT, respectively Dialog#WRAP_CONTENT or
0, if the default height should be usedpublic final int getDialogMaxWidth()
Integer value or
-1, if no maximum width is setpublic final void setDialogMaxWidth(int maxWidth)
maxWidth - The maximum width, which should be set, in pixels as an Integer value. The
maximum width must be at least 1, or -1, if no maximum width should be setpublic final int getDialogMaxHeight()
Integer value
or -1, if no maximum height is setpublic final void setDialogMaxHeight(int maxHeight)
maxHeight - The maximum height, which should be set, in pixels as an Integer value. The
maximum height must be at least 1, or -1, if no maximum height should be setpublic final int getDialogLeftMargin()
Integer valuepublic final int getDialogTopMargin()
Integer valuepublic final int getDialogRightMargin()
Integer valuepublic final int getDialogBottomMargin()
Integer valuepublic final void setDialogMargin(int left,
int top,
int right,
int bottom)
left - The left margin, which should be set, in pixels as an Integer value. The left
margin must be at least 0top - The left margin, which should be set, in pixels as an Integer value. The left
margin must be at least 0right - The left margin, which should be set, in pixels as an Integer value. The left
margin must be at least 0bottom - The left margin, which should be set, in pixels as an Integer value. The left
margin must be at least 0public final int getDialogPaddingLeft()
Integer valuepublic final int getDialogPaddingTop()
Integer valuepublic final int getDialogPaddingRight()
Integer valuepublic final int getDialogPaddingBottom()
Integer valuepublic final void setDialogPadding(int left,
int top,
int right,
int bottom)
left - The left padding, which should be set, in pixels as an Integer value. The
left padding must be at least 0top - The top padding, which should be set, in pixels as an Integer value. The top
padding must be at least 0right - The right padding, which should be set, in pixels as an Integer value. The
right padding must be at least 0bottom - The bottom padding, which should be set, in pixels as an Integer value. The
bottom padding must be at least 0public final boolean isDialogFitsSystemWindowsLeft()
public final boolean isDialogFitsSystemWindowsTop()
public final boolean isDialogFitsSystemWindowsRight()
public final boolean isDialogFitsSystemWindowsBottom()
public final void setDialogFitsSystemWindows(boolean fitsSystemWindows)
fitsSystemWindows - True, if the preference's dialog should inset its content, false otherwisepublic final void setDialogFitsSystemWindows(boolean left,
boolean top,
boolean right,
boolean bottom)
left - True, if the preference's dialog should inset its content at the left edge, false
otherwisetop - True, if the preference's dialog should inset its content at the top edge, false
otherwiseright - True, if the preference's dialog should inset its content at the right edge, false
otherwisebottom - True, if the preference's dialog should inset its content at the bottom edge, false
otherwisepublic final java.lang.CharSequence getDialogTitle()
CharSequence
or null, if the preference's title is used insteadpublic final void setDialogTitle(java.lang.CharSequence dialogTitle)
dialogTitle - The title, which should be set, as an instance of the class CharSequence or
null, if the preference's title should be used insteadpublic final void setDialogTitle(int resourceId)
resourceId - The resource id of the title, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final java.lang.CharSequence getDialogMessage()
CharSequence or null, if no message is shown in the dialogpublic final void setDialogMessage(java.lang.CharSequence dialogMessage)
dialogMessage - The message, which should be set, as an instance of the class CharSequence or
null, if no message should be shown in the dialogpublic final void setDialogMessage(int resourceId)
resourceId - The resource id of the message, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final android.graphics.drawable.Drawable getDialogIcon()
Drawable or
null, if no icon is shown in the dialogpublic final void setDialogIcon(android.graphics.Bitmap dialogIcon)
dialogIcon - The dialog, which should be set, as an instance of the class Bitmap or null,
if no icon should be shown in the dialogpublic final void setDialogIcon(int resourceId)
resourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcepublic final android.content.res.ColorStateList getDialogIconTintList()
ColorStateList or null, if no color state list has been setpublic final void setDialogIconTint(int color)
color - The color, which should be set, as an Integer valuepublic final void setDialogIconTintList(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 getDialogIconTintMode()
PorterDuff.Mode. The mode may not be nullpublic final void setDialogIconTintMode(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 final java.lang.CharSequence getPositiveButtonText()
CharSequence or
null, if no positive button is shown in the dialogpublic final void setPositiveButtonText(java.lang.CharSequence positiveButtonText)
positiveButtonText - The text, which should be set, as an instance of the class CharSequence or
null, if no positive button should be shown in the dialogpublic final void setPositiveButtonText(int resourceId)
resourceId - The resource id of the text, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final java.lang.CharSequence getNegativeButtonText()
CharSequence or
null, if no negative button is shown in the dialogpublic final void setNegativeButtonText(java.lang.CharSequence negativeButtonText)
negativeButtonText - The text, which should be set, as an instance of the class CharSequence or
null, if no negative button should be shown in the dialogpublic final void setNegativeButtonText(int resourceId)
resourceId - The resource id of the text, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcepublic final int getDialogTitleColor()
Integer value or -1, if no custom title color is
setpublic final void setDialogTitleColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom title
should be setpublic final android.graphics.Typeface getDialogTitleTypeface()
Typeface or null, if the default typeface is usedpublic final void setDialogTitleTypeface(android.graphics.Typeface typeface)
typeface - The typeface, which should be set, as an instance of the class Typeface or
null, if the default typeface should be usedpublic final int getDialogMessageColor()
Integer value or -1, if no custom message
color is setpublic final void setDialogMessageColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom
message color should be setpublic final android.graphics.Typeface getDialogMessageTypeface()
Typeface or null, if the default typeface is usedpublic final void setDialogMessageTypeface(android.graphics.Typeface typeface)
typeface - The typeface, which should be set, as an instance of the class Typeface or
null, if the default typeface should be usedpublic final android.content.res.ColorStateList getDialogButtonTextColor()
ColorStateList or
null, if no custom color is setpublic final void setDialogButtonTextColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom color
should be setpublic final void setDialogButtonTextColor(android.content.res.ColorStateList colorStateList)
colorStateList - The color, which should be set, as an instance of the class ColorStateList.
The color state list may not be nullpublic final android.graphics.Typeface getDialogButtonTypeface()
Typeface or null, if the default typeface is usedpublic final void setDialogButtonTypeface(android.graphics.Typeface typeface)
typeface - The typeface, which should be set, as an instance of the class Typeface or
null, if the default typeface should be usedpublic final android.graphics.drawable.Drawable getDialogBackground()
Drawable or null, if no custom background is setpublic final void setDialogBackground(android.graphics.Bitmap background)
background - The background, which should be set, as an instance of the class Bitmap or
null, if no custom background should be setpublic final void setDialogBackground(int resourceId)
resourceId - The resource id of the background, which should be set, as an Integer value.
The resource id must correspond to a valid drawable resourcepublic final void setDialogBackgroundColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom
background color should be setpublic final android.graphics.drawable.Drawable getDialogWindowBackground()
Drawable or null, if no window background is setpublic final void setDialogWindowBackground(int resourceId)
resourceId - The resource id, which corresponds to the window background, which should be set, as
an Integer value. The resource id must correspond to a valid drawable
resourcepublic final void setDialogWindowBackground(android.graphics.Bitmap windowBackground)
windowBackground - The window background, which should be set, as an instance of the class Bitmap or null, if no window background should be setpublic final boolean isValueShownAsSummary()
public final void showValueAsSummary(boolean showValueAsSummary)
showValueAsSummary - True, if the currently persisted value should be shown instead of the summary, false
otherwisepublic final boolean isDialogHeaderShown()
public final void showDialogHeader(boolean show)
show - True, if the header of the preference's dialog should be shown, false otherwisepublic final android.graphics.drawable.Drawable getDialogHeaderBackground()
Drawablepublic final void setDialogHeaderBackground(android.graphics.Bitmap background)
background - The background, which should be set, as an instance of the class Bitmap or
null, if no custom background should be setpublic final void setDialogHeaderBackground(int resourceId)
resourceId - The resource id of the background, which should be set, as an Integer value.
The resource id must correspond to a valid drawable resourcepublic final void setDialogHeaderBackgroundColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom color
should be setpublic final android.graphics.drawable.Drawable getDialogHeaderIcon()
Drawablepublic final void setDialogHeaderIcon(android.graphics.Bitmap icon)
icon - The icon, which should be set, as an instance of the class Bitmap or null, if
no icon should be setpublic final void setDialogHeaderIcon(int resourceId)
resourceId - The resource id of the icon, which should be set, as an Integer value. The
resource id must correspond to a valid drawable resourcepublic final android.content.res.ColorStateList getDialogHeaderIconTintList()
ColorStateList or null, if no color
state list has been setpublic final void setDialogHeaderIconTint(int color)
color - The color, which should be set, as an Integer valuepublic final void setDialogHeaderIconTintList(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 getDialogHeaderIconTintMode()
PorterDuff.Mode. The mode may not be nullpublic final void setDialogHeaderIconTintMode(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 final boolean isDialogButtonBarDividerShown()
public final void showDialogButtonBarDivider(boolean show)
show - True, if the divider, which is located above the buttons of the preference's dialog
should be shown, false otherwisepublic final int getDialogDividerColor()
Integer value or -1, if no custom color is setpublic final void setDialogDividerColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom color
should be setpublic final int getDialogDividerMargin()
Integer valuepublic final void setDialogDividerMargin(int margin)
margin - The left and right margin, which should be set, in pixels as an Integer
value. The margin must be at least 0public final boolean areDialogDividersShownOnScroll()
public final void showDialogDividersOnScroll(boolean show)
show - True, if the dividers, which are located above and below the list view of the
preference's dialog, should be shown when the list view is scrolled, false otherwisepublic final ScrollableArea getDialogScrollableArea()
public final void setDialogScrollableArea(Area area)
area - The area, which should be set, as a value of the enum Area or null, if no scrollable
area should be setpublic final void setDialogScrollableArea(Area top,
Area bottom)
top - The top scrollable area, which should be set, as a value of the enum Area or null, if
no scrollable area should be setbottom - The bottom scrollable area, which should be set, as a value of the enum Area or null,
if no scrollable area should be set. The index of the bottom area must be at leas the
index of the top area. If the top area is null, the bottom area must be null as wellpublic final DialogAnimation getDialogShowAnimation()
public final void setDialogShowAnimation(DialogAnimation animation)
animation - The animation, which should be set, as an instance of the class DialogAnimation or
null, if no animation should be usedpublic final DialogAnimation getDialogDismissAnimation()
public final void setDialogDismissAnimation(DialogAnimation animation)
animation - The animation, which should be set, as an instance of the class DialogAnimation or
null, if no animation should be usedpublic final DialogAnimation getDialogCancelAnimation()
public final void setDialogCancelAnimation(DialogAnimation animation)
animation - The animation, which should be set, as an instance of the class DialogAnimation or
null, if no animation should be usedpublic final void setCustomDialogTitle(android.view.View view)
view - The custom view, which should be set, as an instance of the class View or
null, if no custom view should be usedpublic final void setCustomDialogTitle(int resourceId)
resourceId - The resource id of the custom view, which should be set, as an Integer value.
The resource id must correspond to a valid layout resourcepublic final void setCustomDialogMessage(android.view.View view)
view - The custom view, which should be set, as an instance of the class View or
null, if no custom view should be usedpublic final void setCustomDialogMessage(int resourceId)
resourceId - The resource id of custom view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourcepublic final void setCustomDialogButtonBar(android.view.View view)
view - The custom view, which should be set, as an instance of the class View or
null, if no custom view should be setpublic final void setCustomDialogButtonBar(int resourceId)
resourceId - The resource id of the custom view, which should be set, as an Integer value.
The resource id must correspond to a valid layout resourcepublic final void setCustomDialogHeader(android.view.View view)
view - The custom view, which should be set, as an instance of the class View or
null, if no custom view should be setpublic final void setCustomDialogHeader(int resourceId)
resourceId - The resource id of the custom view, which should be set, as an Integer value.
The resource id must correspond to a valid layout resourcepublic final void setOnClickListener(android.content.DialogInterface.OnClickListener listener)
listener - The listener, which should be set, as an instance of the type DialogInterface.OnClickListener
or null, if no listener should be notifiedpublic final void setOnShowListener(android.content.DialogInterface.OnShowListener listener)
listener - The listener, which should be set, as an instance of the type DialogInterface.OnShowListener
or null, if no listener should be notifiedpublic final void setOnDismissListener(android.content.DialogInterface.OnDismissListener listener)
listener - The listener, which should be set, as an instance of the type DialogInterface.OnDismissListener or null, if no listener should be notifiedpublic final void setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
The listener will only be invoked, when the dialog is canceled. Cancel events alone will not
capture all ways that the dialog might be dismissed. If the creator needs to know when a
dialog is dismissed in general, use setOnDismissListener(android.content.DialogInterface.OnDismissListener).
listener - The listener, which should be set, as an instance of the type DialogInterface.OnCancelListener or null, if no listener should be notifiedpublic final void setOnKeyListener(android.content.DialogInterface.OnKeyListener listener)
listener - The listener, which should be set, as an instance of the type DialogInterface.OnKeyListener
or null, if no listener should be notifiedpublic final void performClick()
PreferenceperformClick in class Preferencepublic void onClick(android.content.DialogInterface dialog,
int which)
onClick in interface android.content.DialogInterface.OnClickListenerpublic void onShow(android.content.DialogInterface dialog)
onShow in interface android.content.DialogInterface.OnShowListenerpublic void onDismiss(android.content.DialogInterface dialog)
onDismiss in interface android.content.DialogInterface.OnDismissListenerpublic void onCancel(android.content.DialogInterface dialog)
onCancel in interface android.content.DialogInterface.OnCancelListenerpublic boolean onKey(android.content.DialogInterface dialog,
int keyCode,
android.view.KeyEvent event)
onKey in interface android.content.DialogInterface.OnKeyListenerprotected void onClick()
protected android.os.Parcelable onSaveInstanceState()
protected void onRestoreInstanceState(android.os.Parcelable state)