DialogType - The type of the dialog, which is created by the builderBuilderType - The type of the builderpublic abstract class AbstractMaterialDialogBuilder<DialogType extends MaterialDialog,BuilderType extends AbstractMaterialDialogBuilder<DialogType,?>>
extends java.lang.Object
| Constructor and Description |
|---|
AbstractMaterialDialogBuilder(android.content.Context context)
Creates a new builder, which allows to create and show dialogs, which are designed according
to Android 5's Material Design guidelines even on pre-Lollipop devices.
|
AbstractMaterialDialogBuilder(android.content.Context context,
int themeResourceId)
Creates a new builder, which allows to create and show dialogs, which are designed according
to Android 5's Material Design guidelines even on pre-Lollipop devices.
|
| Modifier and Type | Method and Description |
|---|---|
DialogType |
create()
Creates a dialog with the arguments, which have been supplied to the builder.
|
android.content.Context |
getContext()
Returns the context, which is used by the builder.
|
protected DialogType |
getDialog()
Returns the dialog, which is configured by the builder.
|
protected void |
obtainStyledAttributes(int themeResourceId)
Obtains all relevant attributes from the current theme.
|
protected abstract DialogType |
onCreateDialog(android.content.Context context,
int themeResourceId)
The method, which is invoked on subclasses in order to create the dialog, which is configured
by the builder.
|
protected BuilderType |
self()
Returns the builder itself, casted to the generic type BuilderType.
|
BuilderType |
setBackground(android.graphics.Bitmap background)
Sets the background of the dialog, which is created by the builder.
|
BuilderType |
setBackground(int resourceId)
Sets the background of the dialog, which is created by the builder.
|
BuilderType |
setBackgroundColor(int color)
Sets the background color of the dialog, which is created by the builder.
|
BuilderType |
setCancelable(boolean cancelable)
Sets, whether the dialog, which is created by the builder, should be cancelable, or not.
|
BuilderType |
setCustomMessage(int resourceId)
Sets the custom view, which should be used to show the message of the dialog, which is
created by the builder.
|
BuilderType |
setCustomMessage(android.view.View view)
Sets the custom view, which should be used to show the message of the dialog, which is
created by the builder.
|
BuilderType |
setCustomTitle(int resourceId)
Sets the custom view, which should be used to show the title of the dialog, which is created
by the builder.
|
BuilderType |
setCustomTitle(android.view.View view)
Sets the custom view, which should be used to show the title of the dialog, which is created
by the builder.
|
BuilderType |
setIcon(android.graphics.Bitmap icon)
Sets the icon of the dialog, which is created by the builder.
|
BuilderType |
setIcon(int resourceId)
Sets the icon of the dialog, which is created by the builder.
|
BuilderType |
setIconAttribute(int attributeId)
Set the icon of the dialog, which is created by the builder.
|
BuilderType |
setMessage(java.lang.CharSequence message)
Sets the message of the dialog, which is created by the builder.
|
BuilderType |
setMessage(int resourceId)
Sets the message of the dialog, which is created by the builder.
|
BuilderType |
setMessageColor(int color)
Sets the color of the message of the dialog, which is created by the builder.
|
BuilderType |
setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
Sets the listener, which should be notified, when the dialog, which is created by the
builder, is canceled.
|
BuilderType |
setOnDismissListener(android.content.DialogInterface.OnDismissListener listener)
Sets the listener, which should be notified, when the dialog, which is created by the
builder, is dismissed for any reason.
|
BuilderType |
setOnShowListener(android.content.DialogInterface.OnShowListener listener)
Sets the listener, which should be notified, when the dialog has been shown.
|
BuilderType |
setTitle(java.lang.CharSequence title)
Sets the title of the dialog, which is created by the builder.
|
BuilderType |
setTitle(int resourceId)
Sets the title of the dialog, which is created by the builder.
|
BuilderType |
setTitleColor(int color)
Sets the color of the title of the dialog, which is created by the builder.
|
BuilderType |
setView(int resourceId)
Sets the custom view, which should be shown by the dialog, which is created by the builder.
|
BuilderType |
setView(android.view.View view)
Sets the custom view, which should be shown by the dialog, which is created by the builder.
|
public AbstractMaterialDialogBuilder(android.content.Context context)
context - The context, which should be used by the builder, as an instance of the class Context. The context may not be nullpublic AbstractMaterialDialogBuilder(android.content.Context context,
int themeResourceId)
context - The context, which should be used by the builder, as an instance of the class Context. The context may not be nullthemeResourceId - The resource id of the theme, which should be used by the dialog, as an Integer value. The resource id must correspond to a valid themeprotected final BuilderType self()
protected final DialogType getDialog()
protected void obtainStyledAttributes(int themeResourceId)
themeResourceId - The resource id of the theme, which should be used by the dialog, as an Integer value. The resource id must correspond to a valid style resourceprotected abstract DialogType onCreateDialog(android.content.Context context, int themeResourceId)
context - The context, which should be used by the dialog, as an instance of the class Context. The context may not be nullthemeResourceId - The resource id of the theme, which should be used by the dialog, as an Integer valuepublic final android.content.Context getContext()
Contextpublic final BuilderType setCancelable(boolean cancelable)
cancelable - True, if the dialog, which is created by the builder, should be cancelable, false
otherwisepublic BuilderType 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 setpublic BuilderType setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
setOnDismissListener.listener - The listener, which should be set, as an instance of the type DialogInterface.OnCancelListener, or null, if no listener should be setsetCancelable(boolean),
setOnDismissListener(android.content.DialogInterface.OnDismissListener)public final BuilderType 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 setpublic final BuilderType setTitleColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom color
should be setpublic final BuilderType setMessageColor(int color)
color - The color, which should be set, as an Integer value or -1, if no custom color
should be setpublic final BuilderType setBackground(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 BuilderType setBackground(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 BuilderType setBackgroundColor(int color)
color - The background color, which should be set, as an Integer value or -1, if no
custom background color should be setpublic final BuilderType setTitle(java.lang.CharSequence title)
title - The title, which should be set, as an instance of the type CharSequence or
null, if no title should be shownpublic final BuilderType setTitle(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 BuilderType setMessage(java.lang.CharSequence message)
message - The message, which should be set, as an instance of the type CharSequence or
null, if no message should be shownpublic final BuilderType setMessage(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 BuilderType setIcon(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 shownpublic final BuilderType setIcon(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 BuilderType setIconAttribute(int attributeId)
attributeId - 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 BuilderType setView(android.view.View view)
view - The view, which should be set, as an instance of the class View or null, if
no custom view should be shownpublic final BuilderType setView(int resourceId)
resourceId - 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 BuilderType setCustomTitle(android.view.View view)
view - 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 BuilderType setCustomTitle(int resourceId)
resourceId - 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 BuilderType setCustomMessage(android.view.View view)
view - 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 messagepublic final BuilderType setCustomMessage(int resourceId)
resourceId - 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 DialogType create()