public class MaterialDialogDecorator extends AbstractDialogDecorator<Dialog> implements MaterialDialogDecorator
| Constructor and Description |
|---|
MaterialDialogDecorator(Dialog dialog)
Creates a new decorator, which allows to modify the view hierarchy of a dialog, which is
designed according to Android 5's Material Design guidelines even on pre-Lollipop devices.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.drawable.Drawable |
getBackground()
Returns the background of the dialog.
|
android.graphics.drawable.Drawable |
getIcon()
Returns the icon of the dialog.
|
java.lang.CharSequence |
getMessage()
Returns the message of the dialog.
|
int |
getMessageColor()
Returns the color of the message of the dialog.
|
java.lang.CharSequence |
getTitle()
Returns the title of the dialog.
|
int |
getTitleColor()
Returns the color of the title of the dialog.
|
protected void |
onAttach(android.view.View view)
The method, which is invoked, when the decorator is attached to the view hierarchy.
|
protected void |
onDetach()
The method, which is invoked, when the decorator is detached from the view hierarchy.
|
void |
onRestoreInstanceState(android.os.Bundle savedInstanceState)
The method, which is invoked in order to restore the state, which has previously stored
within a bundle.
|
void |
onSaveInstanceState(android.os.Bundle outState)
The method, which is invoked in order to stores the decorator's state.
|
void |
setBackground(android.graphics.Bitmap background)
Sets the background of the dialog.
|
void |
setBackground(int resourceId)
Sets the background of the dialog.
|
void |
setBackgroundColor(int color)
Sets the background color of the dialog.
|
void |
setCustomMessage(int resourceId)
Sets the custom view, which should be used to show the message of the dialog.
|
void |
setCustomMessage(android.view.View view)
Sets the custom view, which should be used to show the message of the dialog.
|
void |
setCustomTitle(int resourceId)
Sets the custom view, which should be used to show the title of the dialog.
|
void |
setCustomTitle(android.view.View view)
Sets the custom view, which should be used to show the title of the dialog.
|
void |
setIcon(android.graphics.Bitmap icon)
Sets the icon of the dialog.
|
void |
setIcon(int resourceId)
Sets the icon of the dialog.
|
void |
setIconAttribute(int attributeId)
Set the icon of the dialog.
|
void |
setMessage(java.lang.CharSequence message)
Sets the message of the dialog.
|
void |
setMessage(int resourceId)
Sets the message of the dialog.
|
void |
setMessageColor(int color)
Sets the color of the message of the dialog.
|
void |
setTitle(java.lang.CharSequence title)
Sets the title of the dialog.
|
void |
setTitle(int resourceId)
Sets the title of the dialog.
|
void |
setTitleColor(int color)
Sets the color of the title of the dialog.
|
void |
setView(int resourceId)
Sets the custom view, which should be shown by the dialog.
|
void |
setView(android.view.View view)
Sets the custom view, which should be shown by the dialog.
|
attach, detach, getContext, getDialog, getViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextpublic MaterialDialogDecorator(Dialog dialog)
dialog - The dialog, whose view hierarchy should be modified by the decorator, as an instance
of the type Dialog. The dialog may not be nullpublic final android.graphics.drawable.Drawable getIcon()
MaterialDialogDecoratorgetIcon in interface MaterialDialogDecoratorDrawable or null, if no
icon has been setpublic final void setIcon(android.graphics.Bitmap icon)
MaterialDialogDecoratorsetIcon in interface MaterialDialogDecoratoricon - The icon, which should be set, as an instance of the class Bitmap or null, if
no icon should be shownpublic final void setIcon(int resourceId)
MaterialDialogDecoratorsetIcon in interface MaterialDialogDecoratorresourceId - 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 void setIconAttribute(int attributeId)
MaterialDialogDecoratorsetIconAttribute in interface MaterialDialogDecoratorattributeId - The id of the theme attribute, which supplies the icon, which should be set, as an
Integer value. The id must point to a valid drawable resourcepublic final int getTitleColor()
MaterialDialogDecoratorgetTitleColor in interface MaterialDialogDecoratorInteger valuepublic final void setTitleColor(int color)
MaterialDialogDecoratorsetTitleColor in interface MaterialDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic final int getMessageColor()
MaterialDialogDecoratorgetMessageColor in interface MaterialDialogDecoratorInteger valuepublic final void setMessageColor(int color)
MaterialDialogDecoratorsetMessageColor in interface MaterialDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic final android.graphics.drawable.Drawable getBackground()
MaterialDialogDecoratorgetBackground in interface MaterialDialogDecoratorDrawable or null, if
no background has been setpublic final void setBackground(android.graphics.Bitmap background)
MaterialDialogDecoratorsetBackground in interface MaterialDialogDecoratorbackground - The background, which should be set, as an instance of the class Bitmap or
null, if no background should be setpublic final void setBackground(int resourceId)
MaterialDialogDecoratorsetBackground in interface MaterialDialogDecoratorresourceId - 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 setBackgroundColor(int color)
MaterialDialogDecoratorsetBackgroundColor in interface MaterialDialogDecoratorcolor - The background color, which should be set, as an Integer valuepublic final void setCustomTitle(android.view.View view)
MaterialDialogDecoratorsetCustomTitle in interface MaterialDialogDecoratorview - The view, which should be set, as an instance of the class View or null, if
no custom view should be used to show the titlepublic final void setCustomTitle(int resourceId)
MaterialDialogDecoratorsetCustomTitle in interface MaterialDialogDecoratorresourceId - The resource id of the view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourcepublic final void setCustomMessage(android.view.View view)
MaterialDialogDecoratorsetCustomMessage in interface MaterialDialogDecoratorview - The view, which should be set, as an instance of the class View or null, if
no custom view should be used to show the titlepublic final void setCustomMessage(int resourceId)
MaterialDialogDecoratorsetCustomMessage in interface MaterialDialogDecoratorresourceId - The resource id of the view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourcepublic final void setView(android.view.View view)
MaterialDialogDecoratorsetView in interface MaterialDialogDecoratorview - The view, which should be set, as an instance of the class View or null, if
no custom view should be shownpublic final void setView(int resourceId)
MaterialDialogDecoratorsetView in interface MaterialDialogDecoratorresourceId - The resource id of the view, which should be set, as an Integer value. The
resource id must correspond to a valid layout resourcepublic final java.lang.CharSequence getMessage()
MaterialDialogDecoratorgetMessage in interface MaterialDialogDecoratorCharSequence or null, if
no message has been setpublic final void setMessage(java.lang.CharSequence message)
MaterialDialogDecoratorsetMessage in interface MaterialDialogDecoratormessage - The message, which should be set, as an instance of the type CharSequence or
null, if no message should be shownpublic final void setMessage(int resourceId)
MaterialDialogDecoratorsetMessage in interface MaterialDialogDecoratorresourceId - 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 java.lang.CharSequence getTitle()
MaterialDialogDecoratorgetTitle in interface MaterialDialogDecoratorCharSequence or null, if
no title has been setpublic final void setTitle(java.lang.CharSequence title)
MaterialDialogDecoratorsetTitle in interface MaterialDialogDecoratortitle - The title, which should be set, as an instance of the type CharSequence or
null, if no title should be setpublic final void setTitle(int resourceId)
MaterialDialogDecoratorsetTitle in interface MaterialDialogDecoratorresourceId - The resource id of the title, which should be set, as an Integer. The
resource id must correspond to a valid string resourcepublic final void onSaveInstanceState(android.os.Bundle outState)
DialogDecoratoronSaveInstanceState in interface DialogDecoratoroutState - The bundle, the decorator's state should be stored within, as an instance of the
class Bundle. The bundle may not be nullpublic final void onRestoreInstanceState(android.os.Bundle savedInstanceState)
DialogDecoratoronRestoreInstanceState in interface DialogDecoratorsavedInstanceState - The bundle, which has been used to store the state, as an instance of the class
Bundle. The bundle may not be nullprotected final void onAttach(android.view.View view)
AbstractDialogDecoratoronAttach in class AbstractDialogDecorator<Dialog>view - The root view of the dialog, which is modified by the decorator, as an instance of
the class View. The view may not be nullprotected final void onDetach()
AbstractDialogDecoratoronDetach in class AbstractDialogDecorator<Dialog>