public static class MaterialDialog.Builder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected <any> |
adapter |
protected boolean |
alwaysCallInputCallback |
protected boolean |
alwaysCallMultiChoiceCallback |
protected boolean |
alwaysCallSingleChoiceCallback |
protected boolean |
autoDismiss |
protected int |
backgroundColor |
protected int |
btnSelectorNegative |
protected int |
btnSelectorNeutral |
protected int |
btnSelectorPositive |
protected int |
btnSelectorStacked |
protected GravityEnum |
btnStackedGravity |
protected int |
buttonRippleColor |
protected GravityEnum |
buttonsGravity |
protected MaterialDialog.ButtonCallback |
callback |
protected boolean |
cancelable |
protected boolean |
canceledOnTouchOutside |
protected android.content.DialogInterface.OnCancelListener |
cancelListener |
protected java.lang.CharSequence |
checkBoxPrompt |
protected boolean |
checkBoxPromptInitiallyChecked |
protected android.widget.CompoundButton.OnCheckedChangeListener |
checkBoxPromptListener |
protected android.content.res.ColorStateList |
choiceWidgetColor |
protected java.lang.CharSequence |
content |
protected int |
contentColor |
protected boolean |
contentColorSet |
protected GravityEnum |
contentGravity |
protected float |
contentLineSpacingMultiplier |
protected android.content.Context |
context |
protected android.view.View |
customView |
protected java.lang.Integer[] |
disabledIndices |
protected android.content.DialogInterface.OnDismissListener |
dismissListener |
protected int |
dividerColor |
protected boolean |
dividerColorSet |
protected android.graphics.drawable.Drawable |
icon |
protected boolean |
indeterminateIsHorizontalProgress |
protected boolean |
indeterminateProgress |
protected boolean |
inputAllowEmpty |
protected MaterialDialog.InputCallback |
inputCallback |
protected java.lang.CharSequence |
inputHint |
protected int |
inputMaxLength |
protected int |
inputMinLength |
protected java.lang.CharSequence |
inputPrefill |
protected int |
inputRangeErrorColor |
protected int |
inputType |
protected int |
itemColor |
protected boolean |
itemColorSet |
protected int[] |
itemIds |
protected java.util.ArrayList<java.lang.CharSequence> |
items |
protected GravityEnum |
itemsGravity |
protected android.content.DialogInterface.OnKeyListener |
keyListener |
protected RecyclerView.LayoutManager |
layoutManager |
protected boolean |
limitIconToDefaultSize |
protected android.content.res.ColorStateList |
linkColor |
protected MaterialDialog.ListCallback |
listCallback |
protected MaterialDialog.ListCallbackMultiChoice |
listCallbackMultiChoice |
protected MaterialDialog.ListCallbackSingleChoice |
listCallbackSingleChoice |
protected MaterialDialog.ListLongCallback |
listLongCallback |
protected int |
listSelector |
protected int |
maxIconSize |
protected android.graphics.Typeface |
mediumFont |
protected android.content.res.ColorStateList |
negativeColor |
protected boolean |
negativeColorSet |
protected boolean |
negativeFocus |
protected java.lang.CharSequence |
negativeText |
protected android.content.res.ColorStateList |
neutralColor |
protected boolean |
neutralColorSet |
protected boolean |
neutralFocus |
protected java.lang.CharSequence |
neutralText |
protected MaterialDialog.SingleButtonCallback |
onAnyCallback |
protected MaterialDialog.SingleButtonCallback |
onNegativeCallback |
protected MaterialDialog.SingleButtonCallback |
onNeutralCallback |
protected MaterialDialog.SingleButtonCallback |
onPositiveCallback |
protected android.content.res.ColorStateList |
positiveColor |
protected boolean |
positiveColorSet |
protected boolean |
positiveFocus |
protected java.lang.CharSequence |
positiveText |
protected int |
progress |
protected int |
progressMax |
protected java.lang.String |
progressNumberFormat |
protected java.text.NumberFormat |
progressPercentFormat |
protected android.graphics.Typeface |
regularFont |
protected int |
selectedIndex |
protected java.lang.Integer[] |
selectedIndices |
protected android.content.DialogInterface.OnShowListener |
showListener |
protected boolean |
showMinMax |
protected StackingBehavior |
stackingBehavior |
protected java.lang.Object |
tag |
protected Theme |
theme |
protected java.lang.CharSequence |
title |
protected int |
titleColor |
protected boolean |
titleColorSet |
protected GravityEnum |
titleGravity |
protected int |
widgetColor |
protected boolean |
widgetColorSet |
protected boolean |
wrapCustomViewInScroll |
| Constructor and Description |
|---|
Builder(android.content.Context context) |
protected final android.content.Context context
protected java.lang.CharSequence title
protected GravityEnum titleGravity
protected GravityEnum contentGravity
protected GravityEnum btnStackedGravity
protected GravityEnum itemsGravity
protected GravityEnum buttonsGravity
protected int buttonRippleColor
protected int titleColor
protected int contentColor
protected java.lang.CharSequence content
protected java.util.ArrayList<java.lang.CharSequence> items
protected java.lang.CharSequence positiveText
protected java.lang.CharSequence neutralText
protected java.lang.CharSequence negativeText
protected boolean positiveFocus
protected boolean neutralFocus
protected boolean negativeFocus
protected android.view.View customView
protected int widgetColor
protected android.content.res.ColorStateList choiceWidgetColor
protected android.content.res.ColorStateList positiveColor
protected android.content.res.ColorStateList negativeColor
protected android.content.res.ColorStateList neutralColor
protected android.content.res.ColorStateList linkColor
protected MaterialDialog.ButtonCallback callback
protected MaterialDialog.SingleButtonCallback onPositiveCallback
protected MaterialDialog.SingleButtonCallback onNegativeCallback
protected MaterialDialog.SingleButtonCallback onNeutralCallback
protected MaterialDialog.SingleButtonCallback onAnyCallback
protected MaterialDialog.ListCallback listCallback
protected MaterialDialog.ListLongCallback listLongCallback
protected MaterialDialog.ListCallbackSingleChoice listCallbackSingleChoice
protected MaterialDialog.ListCallbackMultiChoice listCallbackMultiChoice
protected boolean alwaysCallMultiChoiceCallback
protected boolean alwaysCallSingleChoiceCallback
protected Theme theme
protected boolean cancelable
protected boolean canceledOnTouchOutside
protected float contentLineSpacingMultiplier
protected int selectedIndex
protected java.lang.Integer[] selectedIndices
protected java.lang.Integer[] disabledIndices
protected boolean autoDismiss
protected android.graphics.Typeface regularFont
protected android.graphics.Typeface mediumFont
protected android.graphics.drawable.Drawable icon
protected boolean limitIconToDefaultSize
protected int maxIconSize
protected <any> adapter
protected RecyclerView.LayoutManager layoutManager
protected android.content.DialogInterface.OnDismissListener dismissListener
protected android.content.DialogInterface.OnCancelListener cancelListener
protected android.content.DialogInterface.OnKeyListener keyListener
protected android.content.DialogInterface.OnShowListener showListener
protected StackingBehavior stackingBehavior
protected boolean wrapCustomViewInScroll
protected int dividerColor
protected int backgroundColor
protected int itemColor
protected boolean indeterminateProgress
protected boolean showMinMax
protected int progress
protected int progressMax
protected java.lang.CharSequence inputPrefill
protected java.lang.CharSequence inputHint
protected MaterialDialog.InputCallback inputCallback
protected boolean inputAllowEmpty
protected int inputType
protected boolean alwaysCallInputCallback
protected int inputMinLength
protected int inputMaxLength
protected int inputRangeErrorColor
protected int[] itemIds
protected java.lang.CharSequence checkBoxPrompt
protected boolean checkBoxPromptInitiallyChecked
protected android.widget.CompoundButton.OnCheckedChangeListener checkBoxPromptListener
protected java.lang.String progressNumberFormat
protected java.text.NumberFormat progressPercentFormat
protected boolean indeterminateIsHorizontalProgress
protected boolean titleColorSet
protected boolean contentColorSet
protected boolean itemColorSet
protected boolean positiveColorSet
protected boolean neutralColorSet
protected boolean negativeColorSet
protected boolean widgetColorSet
protected boolean dividerColorSet
protected int listSelector
protected int btnSelectorStacked
protected int btnSelectorPositive
protected int btnSelectorNeutral
protected int btnSelectorNegative
protected java.lang.Object tag
public final android.content.Context getContext()
public final int getItemColor()
public final android.graphics.Typeface getRegularFont()
public MaterialDialog.Builder title(int titleRes)
public MaterialDialog.Builder title(java.lang.CharSequence title)
public MaterialDialog.Builder titleGravity(GravityEnum gravity)
public MaterialDialog.Builder buttonRippleColor(int color)
public MaterialDialog.Builder buttonRippleColorRes(int colorRes)
public MaterialDialog.Builder buttonRippleColorAttr(int colorAttr)
public MaterialDialog.Builder titleColor(int color)
public MaterialDialog.Builder titleColorRes(int colorRes)
public MaterialDialog.Builder titleColorAttr(int colorAttr)
public MaterialDialog.Builder typeface(android.graphics.Typeface medium, android.graphics.Typeface regular)
typeface(String,
String) instead, to avoid duplicate Typeface allocations and high memory usage.medium - The font used on titles and action buttons. Null uses device default.regular - The font used everywhere else, like on the content and list items. Null uses
device default.public MaterialDialog.Builder typeface(java.lang.String medium, java.lang.String regular)
medium - The name of font in assets/fonts used on titles and action buttons (null uses
device default). E.g. [your-project]/app/main/assets/fonts/[medium]regular - The name of font in assets/fonts used everywhere else, like content and list
items (null uses device default). E.g. [your-project]/app/main/assets/fonts/[regular]public MaterialDialog.Builder icon(android.graphics.drawable.Drawable icon)
public MaterialDialog.Builder iconRes(int icon)
public MaterialDialog.Builder iconAttr(int iconAttr)
public MaterialDialog.Builder content(int contentRes)
public MaterialDialog.Builder content(int contentRes, boolean html)
public MaterialDialog.Builder content(java.lang.CharSequence content)
public MaterialDialog.Builder content(int contentRes, java.lang.Object... formatArgs)
public MaterialDialog.Builder contentColor(int color)
public MaterialDialog.Builder contentColorRes(int colorRes)
public MaterialDialog.Builder contentColorAttr(int colorAttr)
public MaterialDialog.Builder contentGravity(GravityEnum gravity)
public MaterialDialog.Builder contentLineSpacing(float multiplier)
public MaterialDialog.Builder items(java.util.Collection collection)
public MaterialDialog.Builder items(int itemsRes)
public MaterialDialog.Builder items(java.lang.CharSequence... items)
public MaterialDialog.Builder itemsCallback(MaterialDialog.ListCallback callback)
public MaterialDialog.Builder itemsLongCallback(MaterialDialog.ListLongCallback callback)
public MaterialDialog.Builder itemsColor(int color)
public MaterialDialog.Builder itemsColorRes(int colorRes)
public MaterialDialog.Builder itemsColorAttr(int colorAttr)
public MaterialDialog.Builder itemsGravity(GravityEnum gravity)
public MaterialDialog.Builder itemsIds(int[] idsArray)
public MaterialDialog.Builder itemsIds(int idsArrayRes)
public MaterialDialog.Builder buttonsGravity(GravityEnum gravity)
public MaterialDialog.Builder itemsCallbackSingleChoice(int selectedIndex, MaterialDialog.ListCallbackSingleChoice callback)
selectedIndex - The checkbox index that will be selected initially.callback - The callback that will be called when the presses the positive button.public MaterialDialog.Builder alwaysCallSingleChoiceCallback()
public MaterialDialog.Builder itemsCallbackMultiChoice(java.lang.Integer[] selectedIndices, MaterialDialog.ListCallbackMultiChoice callback)
selectedIndices - The radio button indices that will be selected initially.callback - The callback that will be called when the presses the positive button.public MaterialDialog.Builder itemsDisabledIndices(java.lang.Integer... disabledIndices)
disabledIndices - The item indices that will be disabled from selection.public MaterialDialog.Builder alwaysCallMultiChoiceCallback()
public MaterialDialog.Builder positiveText(int positiveRes)
public MaterialDialog.Builder positiveText(java.lang.CharSequence message)
public MaterialDialog.Builder positiveColor(int color)
public MaterialDialog.Builder positiveColorRes(int colorRes)
public MaterialDialog.Builder positiveColorAttr(int colorAttr)
public MaterialDialog.Builder positiveColor(android.content.res.ColorStateList colorStateList)
public MaterialDialog.Builder positiveFocus(boolean isFocusedDefault)
public MaterialDialog.Builder neutralText(int neutralRes)
public MaterialDialog.Builder neutralText(java.lang.CharSequence message)
public MaterialDialog.Builder negativeColor(int color)
public MaterialDialog.Builder negativeColorRes(int colorRes)
public MaterialDialog.Builder negativeColorAttr(int colorAttr)
public MaterialDialog.Builder negativeColor(android.content.res.ColorStateList colorStateList)
public MaterialDialog.Builder negativeText(int negativeRes)
public MaterialDialog.Builder negativeText(java.lang.CharSequence message)
public MaterialDialog.Builder negativeFocus(boolean isFocusedDefault)
public MaterialDialog.Builder neutralColor(int color)
public MaterialDialog.Builder neutralColorRes(int colorRes)
public MaterialDialog.Builder neutralColorAttr(int colorAttr)
public MaterialDialog.Builder neutralColor(android.content.res.ColorStateList colorStateList)
public MaterialDialog.Builder neutralFocus(boolean isFocusedDefault)
public MaterialDialog.Builder linkColor(int color)
public MaterialDialog.Builder linkColorRes(int colorRes)
public MaterialDialog.Builder linkColorAttr(int colorAttr)
public MaterialDialog.Builder linkColor(android.content.res.ColorStateList colorStateList)
public MaterialDialog.Builder listSelector(int selectorRes)
public MaterialDialog.Builder btnSelectorStacked(int selectorRes)
public MaterialDialog.Builder btnSelector(int selectorRes)
public MaterialDialog.Builder btnSelector(int selectorRes, DialogAction which)
public MaterialDialog.Builder btnStackedGravity(GravityEnum gravity)
GravityEnum.END.gravity - The gravity to use.public MaterialDialog.Builder checkBoxPrompt(java.lang.CharSequence prompt, boolean initiallyChecked, android.widget.CompoundButton.OnCheckedChangeListener checkListener)
public MaterialDialog.Builder checkBoxPromptRes(int prompt, boolean initiallyChecked, android.widget.CompoundButton.OnCheckedChangeListener checkListener)
public MaterialDialog.Builder customView(int layoutRes, boolean wrapInScrollView)
public MaterialDialog.Builder customView(android.view.View view, boolean wrapInScrollView)
public MaterialDialog.Builder progress(boolean indeterminate, int max)
indeterminate - If true, an infinite circular spinner is shown. If false, a horizontal
progress bar is shown that is incremented or set via the built MaterialDialog instance.max - When indeterminate is false, the max value the horizontal progress bar can get to.public MaterialDialog.Builder progress(boolean indeterminate, int max, boolean showMinMax)
indeterminate - If true, an infinite circular spinner is shown. If false, a horizontal
progress bar is shown that is incremented or set via the built MaterialDialog instance.max - When indeterminate is false, the max value the horizontal progress bar can get to.showMinMax - For determinate dialogs, the min and max will be displayed to the left
(start) of the progress bar, e.g. 50/100.public MaterialDialog.Builder progressNumberFormat(java.lang.String format)
public MaterialDialog.Builder progressPercentFormat(java.text.NumberFormat format)
public MaterialDialog.Builder progressIndeterminateStyle(boolean horizontal)
public MaterialDialog.Builder widgetColor(int color)
public MaterialDialog.Builder widgetColorRes(int colorRes)
public MaterialDialog.Builder widgetColorAttr(int colorAttr)
public MaterialDialog.Builder choiceWidgetColor(android.content.res.ColorStateList colorStateList)
public MaterialDialog.Builder dividerColor(int color)
public MaterialDialog.Builder dividerColorRes(int colorRes)
public MaterialDialog.Builder dividerColorAttr(int colorAttr)
public MaterialDialog.Builder backgroundColor(int color)
public MaterialDialog.Builder backgroundColorRes(int colorRes)
public MaterialDialog.Builder backgroundColorAttr(int colorAttr)
public MaterialDialog.Builder callback(MaterialDialog.ButtonCallback callback)
public MaterialDialog.Builder onPositive(MaterialDialog.SingleButtonCallback callback)
public MaterialDialog.Builder onNegative(MaterialDialog.SingleButtonCallback callback)
public MaterialDialog.Builder onNeutral(MaterialDialog.SingleButtonCallback callback)
public MaterialDialog.Builder onAny(MaterialDialog.SingleButtonCallback callback)
public MaterialDialog.Builder theme(Theme theme)
public MaterialDialog.Builder cancelable(boolean cancelable)
public MaterialDialog.Builder canceledOnTouchOutside(boolean canceledOnTouchOutside)
public MaterialDialog.Builder autoDismiss(boolean dismiss)
dismiss - Whether or not to dismiss the dialog automatically.public MaterialDialog.Builder adapter(<any> adapter, RecyclerView.LayoutManager layoutManager)
android.support.v7.widget.RecyclerView.Adapter for the dialog's listadapter - The adapter to set to the list.layoutManager - The layout manager to use in the RecyclerView. Pass null to use the
default linear manager.public MaterialDialog.Builder limitIconToDefaultSize()
public MaterialDialog.Builder maxIconSize(int maxIconSize)
public MaterialDialog.Builder maxIconSizeRes(int maxIconSizeRes)
public MaterialDialog.Builder showListener(android.content.DialogInterface.OnShowListener listener)
public MaterialDialog.Builder dismissListener(android.content.DialogInterface.OnDismissListener listener)
public MaterialDialog.Builder cancelListener(android.content.DialogInterface.OnCancelListener listener)
public MaterialDialog.Builder keyListener(android.content.DialogInterface.OnKeyListener listener)
public MaterialDialog.Builder stackingBehavior(StackingBehavior behavior)
behavior - The behavior of the action button stacking logic.public MaterialDialog.Builder input(java.lang.CharSequence hint, java.lang.CharSequence prefill, boolean allowEmptyInput, MaterialDialog.InputCallback callback)
public MaterialDialog.Builder input(java.lang.CharSequence hint, java.lang.CharSequence prefill, MaterialDialog.InputCallback callback)
public MaterialDialog.Builder input(int hint, int prefill, boolean allowEmptyInput, MaterialDialog.InputCallback callback)
public MaterialDialog.Builder input(int hint, int prefill, MaterialDialog.InputCallback callback)
public MaterialDialog.Builder inputType(int type)
public MaterialDialog.Builder inputRange(int minLength, int maxLength)
public MaterialDialog.Builder inputRange(int minLength, int maxLength, int errorColor)
errorColor - Pass in 0 for the default red error color (as specified in guidelines).public MaterialDialog.Builder inputRangeRes(int minLength, int maxLength, int errorColor)
inputRange(int, int, int), but it takes a color resource ID for the error
color.public MaterialDialog.Builder alwaysCallInputCallback()
public MaterialDialog.Builder tag(java.lang.Object tag)
public MaterialDialog build()
public MaterialDialog show()