public abstract class AbstractMaterialDialogFragment extends DialogFragment implements MaterialDialog
android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Constructor and Description |
|---|
AbstractMaterialDialogFragment()
Creates a dialog, which is designed according to Android 5's Material Design guidelines even
on pre-Lollipop devices and is able to show fragments.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
android.graphics.drawable.Drawable |
getBackground()
Returns the background of the dialog.
|
android.content.Context |
getContext()
Returns the context, which is used by 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 |
onAttachDecorators(android.view.View view,
FragmentManager fragmentManager)
The method, which is invoked when the dialog's decorators should be attached.
|
void |
onCancel(android.content.DialogInterface dialog) |
android.app.Dialog |
onCreateDialog(android.os.Bundle savedInstanceState) |
android.view.View |
onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState) |
void |
onDestroy() |
void |
onDestroyView() |
protected void |
onDetachDecorators()
The method, which is invoked when the dialog's decorators should be detached.
|
void |
onDismiss(android.content.DialogInterface dialog) |
protected void |
onRestoreInstanceState(android.os.Bundle savedInstanceState)
The method, which is invoked when the dialog is re-created in order to restore its state.
|
void |
onSaveInstanceState(android.os.Bundle outState) |
void |
onStart() |
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.
|
protected void |
setContext(android.content.Context context)
Sets the context, which should be used by 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 |
setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
Sets the listener, which should be notified, when the dialog is canceled.
|
void |
setOnDismissListener(android.content.DialogInterface.OnDismissListener listener)
Sets the listener, which should be notified, when the dialog is dismissed for any reason.
|
void |
setOnShowListener(android.content.DialogInterface.OnShowListener listener)
Sets the listener, which should be notified, when the dialog has been shown.
|
protected void |
setThemeResourceId(int themeResourceId)
Sets the resource id of the theme, which should be used by 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetCancelablepublic AbstractMaterialDialogFragment()
protected final void setThemeResourceId(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 themeprotected final void setContext(android.content.Context context)
context - The context, which should be set, as an instance of the class Context. The
context may not be nullprotected void onAttachDecorators(android.view.View view,
FragmentManager fragmentManager)
view - The root view of the view hierarchy, which should be modified by the decorators, as
an instance of the class View. The view may not be nullfragmentManager - The fragment manager, which can be used to show fragment within the dialog, as an
instance of the class FragmentManager. The fragment manager may not be nullprotected void onDetachDecorators()
protected void onRestoreInstanceState(android.os.Bundle savedInstanceState)
onSaveInstanceState-method.savedInstanceState - The bundle, which has been used to store the state, as an instance of the class
Bundle. The bundle may not be nullpublic final void setOnShowListener(android.content.DialogInterface.OnShowListener listener)
MaterialDialogsetOnShowListener in interface MaterialDialoglistener - The listener, which should be set, as an instance of the type DialogInterface.OnShowListener, or null, if no listener should be setpublic final void setOnCancelListener(android.content.DialogInterface.OnCancelListener listener)
MaterialDialogsetOnDismissListener.setOnCancelListener in interface MaterialDialoglistener - The listener, which should be set, as an instance of the type DialogInterface.OnCancelListener, or null, if no listener should be setMaterialDialog.setCancelable(boolean),
MaterialDialog.setOnDismissListener(android.content.DialogInterface.OnDismissListener)public void setOnDismissListener(android.content.DialogInterface.OnDismissListener listener)
MaterialDialogsetOnDismissListener in interface MaterialDialoglistener - The listener, which should be set, as an instance of the type DialogInterface.OnDismissListener, or null, if no listener should be setpublic 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 cancel()
cancel in interface android.content.DialogInterfacepublic final android.content.Context getContext()
DialoggetContext in interface DialogContextpublic final android.app.Dialog onCreateDialog(android.os.Bundle savedInstanceState)
public final android.view.View onCreateView(android.view.LayoutInflater inflater,
android.view.ViewGroup container,
android.os.Bundle savedInstanceState)
public final void onStart()
public final void onDestroy()
public final void onDestroyView()
public final void onDismiss(android.content.DialogInterface dialog)
public final void onCancel(android.content.DialogInterface dialog)
public void onSaveInstanceState(android.os.Bundle outState)