public class MaterialDialog
extends android.app.Dialog
implements android.view.View.OnClickListener
| Modifier and Type | Class and Description |
|---|---|
static class |
MaterialDialog.Builder
The class used to construct a MaterialDialog.
|
static class |
MaterialDialog.ButtonCallback
Deprecated.
Use the individual onPositive, onNegative, onNeutral, or onAny Builder methods
instead.
|
static interface |
MaterialDialog.InputCallback |
static interface |
MaterialDialog.ListCallback
A callback used for regular list dialogs.
|
static interface |
MaterialDialog.ListCallbackMultiChoice
A callback used for multi choice (check box) list dialogs.
|
static interface |
MaterialDialog.ListCallbackSingleChoice
A callback used for multi choice (check box) list dialogs.
|
static interface |
MaterialDialog.ListLongCallback
A callback used for regular list dialogs.
|
static interface |
MaterialDialog.SingleButtonCallback
An alternate way to define a single callback.
|
android.content.DialogInterface.OnCancelListener, android.content.DialogInterface.OnClickListener, android.content.DialogInterface.OnDismissListener, android.content.DialogInterface.OnKeyListener, android.content.DialogInterface.OnMultiChoiceClickListener, android.content.DialogInterface.OnShowListener| Modifier and Type | Field and Description |
|---|---|
protected MaterialDialog.Builder |
builder |
protected android.widget.TextView |
content |
protected android.widget.ImageView |
icon |
protected android.widget.TextView |
title |
protected MDRootLayout |
view |
| Modifier | Constructor and Description |
|---|---|
protected |
MaterialDialog(MaterialDialog.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearSelectedIndices()
Clears all selected checkboxes from multi choice list dialogs.
|
void |
clearSelectedIndices(boolean sendCallback)
Clears all selected checkboxes from multi choice list dialogs.
|
void |
dismiss() |
android.view.View |
findViewById(int id) |
MDButton |
getActionButton(DialogAction which)
Retrieves the view of an action button, allowing you to modify properties such as whether or
not it's enabled.
|
MaterialDialog.Builder |
getBuilder() |
android.widget.TextView |
getContentView()
Retrieves the TextView that contains the dialog content.
|
int |
getCurrentProgress() |
android.view.View |
getCustomView()
Retrieves the custom view that was inflated or set to the MaterialDialog during building.
|
android.widget.ImageView |
getIconView()
Retrieves the ImageView that contains the dialog icon.
|
android.widget.EditText |
getInputEditText() |
java.util.ArrayList<java.lang.CharSequence> |
getItems() |
int |
getMaxProgress() |
android.widget.ProgressBar |
getProgressBar() |
RecyclerView |
getRecyclerView() |
int |
getSelectedIndex()
Convenience method for getting the currently selected index of a single choice list.
|
java.lang.Integer[] |
getSelectedIndices()
Convenience method for getting the currently selected indices of a multi choice list
|
java.lang.Object |
getTag() |
android.widget.TextView |
getTitleView()
Retrieves the TextView that contains the dialog title.
|
android.view.View |
getView()
Retrieves the view representing the dialog as a whole.
|
boolean |
hasActionButtons()
Gets whether or not the positive, neutral, or negative action button is visible.
|
void |
incrementProgress(int by) |
boolean |
isCancelled() |
boolean |
isIndeterminateProgress() |
boolean |
isPromptCheckBoxChecked() |
void |
notifyItemChanged(int index) |
void |
notifyItemInserted(int index) |
void |
notifyItemsChanged() |
int |
numberOfActionButtons()
Gets the number of visible action buttons.
|
void |
onClick(android.view.View v) |
boolean |
onItemSelected(MaterialDialog dialog,
android.view.View view,
int position,
java.lang.CharSequence text,
boolean longPress) |
void |
onShow(android.content.DialogInterface dialog) |
void |
selectAllIndices()
Selects all checkboxes in multi choice list dialogs.
|
void |
selectAllIndices(boolean sendCallback)
Selects all checkboxes in multi choice list dialogs.
|
void |
setActionButton(DialogAction which,
java.lang.CharSequence title)
Updates an action button's title, causing invalidation to check if the action buttons should be
stacked.
|
void |
setActionButton(DialogAction which,
int titleRes)
Updates an action button's title, causing invalidation to check if the action buttons should be
stacked.
|
void |
setContent(java.lang.CharSequence newContent) |
void |
setContent(int newContentRes) |
void |
setContent(int newContentRes,
java.lang.Object... formatArgs) |
void |
setContentView(int layoutResID)
Deprecated.
|
void |
setContentView(android.view.View view)
Deprecated.
|
void |
setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
Deprecated.
|
void |
setIcon(android.graphics.drawable.Drawable d) |
void |
setIcon(int resId) |
void |
setIconAttribute(int attrId) |
void |
setItems(java.lang.CharSequence... items) |
void |
setMaxProgress(int max) |
void |
setOnShowListener(android.content.DialogInterface.OnShowListener listener) |
void |
setProgress(int progress) |
void |
setProgressNumberFormat(java.lang.String format)
Change the format of the small text showing current and maximum units of progress.
|
void |
setProgressPercentFormat(java.text.NumberFormat format)
Change the format of the small text showing the percentage of progress.
|
void |
setPromptCheckBoxChecked(boolean checked) |
void |
setSelectedIndex(int index)
Convenience method for setting the currently selected index of a single choice list.
|
void |
setSelectedIndices(java.lang.Integer[] indices)
Convenience method for setting the currently selected indices of a multi choice list.
|
void |
setTitle(java.lang.CharSequence newTitle) |
void |
setTitle(int newTitleRes) |
void |
setTitle(int newTitleRes,
java.lang.Object... formatArgs) |
void |
setTypeface(android.widget.TextView target,
android.graphics.Typeface t) |
void |
show() |
addContentView, cancel, closeOptionsMenu, create, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, invalidateOptionsMenu, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onBackPressed, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onStart, onStop, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOwnerActivity, setVolumeControlStream, takeKeyEvents, unregisterForContextMenuprotected final MaterialDialog.Builder builder
protected android.widget.ImageView icon
protected android.widget.TextView title
protected android.widget.TextView content
protected MDRootLayout view
protected MaterialDialog(MaterialDialog.Builder builder)
public final MaterialDialog.Builder getBuilder()
public final void setTypeface(android.widget.TextView target,
android.graphics.Typeface t)
public java.lang.Object getTag()
public boolean onItemSelected(MaterialDialog dialog, android.view.View view, int position, java.lang.CharSequence text, boolean longPress)
public RecyclerView getRecyclerView()
public boolean isPromptCheckBoxChecked()
public void setPromptCheckBoxChecked(boolean checked)
public final void onClick(android.view.View v)
onClick in interface android.view.View.OnClickListenerpublic void show()
show in class android.app.Dialogpublic final MDButton getActionButton(DialogAction which)
setActionButton(DialogAction, int) to change text, since the
view returned here is not the view that displays text.which - The action button of which to get the view for.public final android.view.View getView()
public final android.widget.EditText getInputEditText()
public final android.widget.TextView getTitleView()
setTitle(CharSequence) instead.public android.widget.ImageView getIconView()
public final android.widget.TextView getContentView()
setContent(CharSequence) instead.public final android.view.View getCustomView()
public final void setActionButton(DialogAction which, java.lang.CharSequence title)
which - The action button to update.title - The new title of the action button.public final void setActionButton(DialogAction which, int titleRes)
which - The action button to update.titleRes - The string resource of the new title of the action button.public final boolean hasActionButtons()
public final int numberOfActionButtons()
public final void setTitle(java.lang.CharSequence newTitle)
setTitle in class android.app.Dialogpublic final void setTitle(int newTitleRes)
setTitle in class android.app.Dialogpublic final void setTitle(int newTitleRes,
java.lang.Object... formatArgs)
public void setIcon(int resId)
public void setIcon(android.graphics.drawable.Drawable d)
public void setIconAttribute(int attrId)
public final void setContent(java.lang.CharSequence newContent)
public final void setContent(int newContentRes)
public final void setContent(int newContentRes,
java.lang.Object... formatArgs)
public final java.util.ArrayList<java.lang.CharSequence> getItems()
public final void setItems(java.lang.CharSequence... items)
public final void notifyItemInserted(int index)
public final void notifyItemChanged(int index)
public final void notifyItemsChanged()
public final int getCurrentProgress()
public android.widget.ProgressBar getProgressBar()
public final void incrementProgress(int by)
public final void setProgress(int progress)
public final boolean isIndeterminateProgress()
public final int getMaxProgress()
public final void setMaxProgress(int max)
public final void setProgressPercentFormat(java.text.NumberFormat format)
public final void setProgressNumberFormat(java.lang.String format)
public final boolean isCancelled()
public int getSelectedIndex()
public void setSelectedIndex(int index)
index - The index of the list item to check.public java.lang.Integer[] getSelectedIndices()
public void setSelectedIndices(java.lang.Integer[] indices)
indices - The indices of the list items to check.public void clearSelectedIndices()
public void clearSelectedIndices(boolean sendCallback)
sendCallback - Defaults to true. True will notify the multi-choice callback, if any.public void selectAllIndices()
public void selectAllIndices(boolean sendCallback)
sendCallback - Defaults to true. True will notify the multi-choice callback, if any.public final void onShow(android.content.DialogInterface dialog)
onShow in interface android.content.DialogInterface.OnShowListenerpublic void dismiss()
dismiss in interface android.content.DialogInterfacedismiss in class android.app.Dialogpublic android.view.View findViewById(int id)
findViewById in class android.app.Dialogpublic final void setOnShowListener(android.content.DialogInterface.OnShowListener listener)
setOnShowListener in class android.app.Dialog@Deprecated
public void setContentView(int layoutResID)
throws java.lang.IllegalAccessError
setContentView in class android.app.Dialogjava.lang.IllegalAccessError@Deprecated
public void setContentView(android.view.View view)
throws java.lang.IllegalAccessError
setContentView in class android.app.Dialogjava.lang.IllegalAccessError@Deprecated
public void setContentView(android.view.View view,
android.view.ViewGroup.LayoutParams params)
throws java.lang.IllegalAccessError
setContentView in class android.app.Dialogjava.lang.IllegalAccessError