public class HeaderDialogDecorator extends AbstractDialogDecorator<MaterialDialog> implements HeaderDialogDecorator
| Constructor and Description |
|---|
HeaderDialogDecorator(MaterialDialog 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 and
may contain a header.
|
| Modifier and Type | Method and Description |
|---|---|
android.graphics.drawable.Drawable |
getHeaderBackground()
Returns the background of the dialog's header.
|
int |
getHeaderDividerColor()
Returns the color of the divider of the dialog's header.
|
int |
getHeaderHeight()
Returns the height of the dialog's header.
|
android.graphics.drawable.Drawable |
getHeaderIcon()
Returns the icon of the dialog's header.
|
boolean |
isHeaderDividerShown()
Returns, whether the divider of the dialog's header is shown, or not.
|
boolean |
isHeaderShown()
Returns, whether the dialog's header is shown, or not.
|
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 |
setHeaderBackground(android.graphics.Bitmap background)
Sets the background of the dialog's header.
|
void |
setHeaderBackground(int resourceId)
Sets the background of the dialog's header.
|
void |
setHeaderBackgroundColor(int color)
Sets the background color of the dialog's header.
|
void |
setHeaderDividerColor(int color)
Sets the color of the divider of the dialog's header.
|
void |
setHeaderHeight(int height)
Sets the height of the dialog's header.
|
void |
setHeaderIcon(android.graphics.Bitmap icon)
Sets the icon of the dialog's header.
|
void |
setHeaderIcon(int resourceId)
Sets the icon of the dialog's header.
|
void |
showHeader(boolean show)
Sets, whether the dialog's header should be shown, or not.
|
void |
showHeaderDivider(boolean show)
Sets, whether the divider of the dialog's header should be shown, or not.
|
attach, detach, getContext, getDialog, getViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextpublic HeaderDialogDecorator(MaterialDialog dialog)
dialog - The dialog, whose view hierarchy should be modified by the decorator, as an instance
of the type MaterialDialog. The dialog may not be nullpublic final boolean isHeaderShown()
HeaderDialogDecoratorisHeaderShown in interface HeaderDialogDecoratorpublic final void showHeader(boolean show)
HeaderDialogDecoratorshowHeader in interface HeaderDialogDecoratorshow - True, if the dialog's header should be shown, false otherwisepublic final int getHeaderHeight()
HeaderDialogDecoratorgetHeaderHeight in interface HeaderDialogDecoratorInteger valuepublic final void setHeaderHeight(int height)
HeaderDialogDecoratorsetHeaderHeight in interface HeaderDialogDecoratorheight - The height, which should be set, in pixels as an Integer value. The height
must be at least 0public final android.graphics.drawable.Drawable getHeaderBackground()
HeaderDialogDecoratorgetHeaderBackground in interface HeaderDialogDecoratorDrawablepublic final void setHeaderBackground(android.graphics.Bitmap background)
HeaderDialogDecoratorsetHeaderBackground in interface HeaderDialogDecoratorbackground - The background, which should be set, as an instance of the class Bitmap or
null, if no background should be shownpublic final void setHeaderBackground(int resourceId)
HeaderDialogDecoratorsetHeaderBackground in interface HeaderDialogDecoratorresourceId - 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 setHeaderBackgroundColor(int color)
HeaderDialogDecoratorsetHeaderBackgroundColor in interface HeaderDialogDecoratorcolor - The background color, which should be set, as an Integer valuepublic final android.graphics.drawable.Drawable getHeaderIcon()
HeaderDialogDecoratorgetHeaderIcon in interface HeaderDialogDecoratorDrawable or null,
if no icon has been setpublic final void setHeaderIcon(android.graphics.Bitmap icon)
HeaderDialogDecoratorsetHeaderIcon in interface HeaderDialogDecoratoricon - The icon, which should be set, as an instance of the class Bitmap or null, if
no icon should be setpublic final void setHeaderIcon(int resourceId)
HeaderDialogDecoratorsetHeaderIcon in interface HeaderDialogDecoratorresourceId - 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 int getHeaderDividerColor()
HeaderDialogDecoratorgetHeaderDividerColor in interface HeaderDialogDecoratorInteger valuepublic final void setHeaderDividerColor(int color)
HeaderDialogDecoratorsetHeaderDividerColor in interface HeaderDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic final boolean isHeaderDividerShown()
HeaderDialogDecoratorisHeaderDividerShown in interface HeaderDialogDecoratorpublic final void showHeaderDivider(boolean show)
HeaderDialogDecoratorshowHeaderDivider in interface HeaderDialogDecoratorshow - True, if the divider of the dialog's header should be shown, false otherwisepublic 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<MaterialDialog>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<MaterialDialog>