public class MaterialDialog
extends android.app.Dialog
implements android.view.View.OnClickListener, android.widget.AdapterView.OnItemClickListener
| 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 class |
MaterialDialog.DialogException |
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.
|
protected static class |
MaterialDialog.ListType |
static class |
MaterialDialog.NotImplementedException |
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 android.widget.TextView |
content |
protected android.widget.FrameLayout |
customViewFrame |
protected android.widget.ImageView |
icon |
protected android.widget.EditText |
input |
protected android.widget.TextView |
inputMinMax |
protected MaterialDialog.ListType |
listType |
protected android.widget.ListView |
listView |
protected MaterialDialog.Builder |
mBuilder |
protected android.widget.ProgressBar |
mProgress |
protected android.widget.TextView |
mProgressLabel |
protected android.widget.TextView |
mProgressMinMax |
protected MDButton |
negativeButton |
protected MDButton |
neutralButton |
protected MDButton |
positiveButton |
protected java.util.List<java.lang.Integer> |
selectedIndicesList |
protected android.widget.TextView |
title |
protected android.view.View |
titleFrame |
protected MDRootLayout |
view |
| Modifier | Constructor and Description |
|---|---|
protected |
MaterialDialog(MaterialDialog.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkIfListInitScroll() |
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() |
protected android.graphics.drawable.Drawable |
getListSelector() |
android.widget.ListView |
getListView() |
int |
getMaxProgress() |
android.widget.ProgressBar |
getProgressBar() |
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
|
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) |
protected void |
invalidateInputMinMaxIndicator(int currentLength,
boolean emptyDisabled) |
protected void |
invalidateList()
Sets the dialog ListView's adapter and it's item click listener.
|
boolean |
isCancelled() |
boolean |
isIndeterminateProgress() |
int |
numberOfActionButtons()
Gets the number of visible action buttons.
|
void |
onClick(android.view.View v) |
void |
onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id) |
void |
onShow(android.content.DialogInterface dialog) |
void |
selectAllIndicies()
Selects all checkboxes in multi choice list dialogs.
|
void |
selectAllIndicies(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) |
protected void |
setInternalInputCallback() |
void |
setItems(java.lang.CharSequence... items) |
void |
setMaxProgress(int max) |
void |
setMessage(java.lang.CharSequence message)
Deprecated.
Use setContent() instead.
|
void |
setOnShowListener(android.content.DialogInterface.OnShowListener listener) |
protected void |
setOnShowListenerInternal() |
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 |
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) |
protected void |
setViewInternal(android.view.View view) |
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 mBuilder
protected android.widget.ListView listView
protected android.widget.ImageView icon
protected android.widget.TextView title
protected android.view.View titleFrame
protected android.widget.FrameLayout customViewFrame
protected android.widget.ProgressBar mProgress
protected android.widget.TextView mProgressLabel
protected android.widget.TextView mProgressMinMax
protected android.widget.TextView content
protected android.widget.EditText input
protected android.widget.TextView inputMinMax
protected MDButton positiveButton
protected MDButton neutralButton
protected MDButton negativeButton
protected MaterialDialog.ListType listType
protected java.util.List<java.lang.Integer> selectedIndicesList
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)
protected final void checkIfListInitScroll()
protected final void invalidateList()
public void onItemClick(android.widget.AdapterView<?> parent,
android.view.View view,
int position,
long id)
onItemClick in interface android.widget.AdapterView.OnItemClickListenerprotected final android.graphics.drawable.Drawable getListSelector()
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.ListView getListView()
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)
@Deprecated public void setMessage(java.lang.CharSequence message)
public final void setItems(java.lang.CharSequence... items)
public final int getCurrentProgress()
public android.widget.ProgressBar getProgressBar()
public final void incrementProgress(int by)
public final void setProgress(int progress)
public final void setMaxProgress(int max)
public final boolean isIndeterminateProgress()
public final int getMaxProgress()
public final void setProgressPercentFormat(java.text.NumberFormat format)
public final void setProgressNumberFormat(java.lang.String format)
public final boolean isCancelled()
public int getSelectedIndex()
public java.lang.Integer[] getSelectedIndices()
public void setSelectedIndex(int index)
index - The index of the list item to check.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 selectAllIndicies()
public void selectAllIndicies(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.OnShowListenerprotected void setInternalInputCallback()
protected void invalidateInputMinMaxIndicator(int currentLength,
boolean emptyDisabled)
public 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.Dialogprotected final void setOnShowListenerInternal()
protected final void setViewInternal(android.view.View view)
@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