public abstract class AbstractButtonBarDialog extends AbstractValidateableDialog implements ButtonBarDialog
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 | Constructor and Description |
|---|---|
protected |
AbstractButtonBarDialog(android.content.Context context,
int themeResourceId)
Creates a dialog, which is designed according to Android 5's Material Design guidelines even
on pre-Lollipop devices and may contain up to three buttons.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areButtonsStacked()
Returns, whether the buttons of the dialog are aligned vertically, or not.
|
android.widget.Button |
getButton(int whichButton)
Returns one of the buttons, which is shown by the dialog.
|
int |
getButtonBarDividerColor()
Returns the color of the divider, which is located above the dialog's buttons.
|
int |
getButtonTextColor()
Returns the color of the button texts of the dialog.
|
boolean |
isButtonBarDividerShown()
Returns, whether the divider, which is located above the dialog's buttons, is shown, or not.
|
protected void |
onAttachDecorators(android.view.View view)
The method, which is invoked when the dialog's decorators should be attached.
|
protected void |
onDetachDecorators()
The method, which is invoked when the dialog's decorators should be detached.
|
void |
onRestoreInstanceState(android.os.Bundle savedInstanceState) |
android.os.Bundle |
onSaveInstanceState() |
void |
setButtonBarDividerColor(int color)
Sets the color of the divider, which is located above the dialog's buttons.
|
void |
setButtonTextColor(int color)
Sets the color of the button texts of the dialog.
|
void |
setNegativeButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the negative button of the dialog.
|
void |
setNegativeButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the negative button of the dialog.
|
void |
setNeutralButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the neutral button of the dialog.
|
void |
setNeutralButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the neutral button of the dialog.
|
void |
setPositiveButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the positive button of the dialog.
|
void |
setPositiveButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
Sets the text of the positive button of the dialog.
|
void |
showButtonBarDivider(boolean show)
Sets, whether the divider, which is located above the dialog's buttons, should be shown, or
not.
|
void |
stackButtons(boolean stackButtons)
Sets, whether the buttons of the dialog should be aligned vertically, or not.
|
addAllValidators, addValidator, getValidators, removeAllValidators, removeValidatorgetHeaderBackground, getHeaderDividerColor, getHeaderHeight, getHeaderIcon, isHeaderDividerShown, isHeaderShown, setHeaderBackground, setHeaderBackground, setHeaderBackgroundColor, setHeaderDividerColor, setHeaderHeight, setHeaderIcon, setHeaderIcon, showHeader, showHeaderDividergetBackground, getIcon, getMessage, getMessageColor, getTitle, getTitleColor, onStart, onStop, setBackground, setBackground, setBackgroundColor, setCustomMessage, setCustomMessage, setCustomTitle, setCustomTitle, setIcon, setIcon, setIconAttribute, setMessage, setMessage, setMessageColor, setTitle, setTitleColor, setView, setViewaddContentView, cancel, closeOptionsMenu, create, dismiss, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, findViewById, 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, onSearchRequested, onSearchRequested, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenuclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetCancelable, setOnCancelListener, setOnDismissListener, setOnShowListenergetBackground, getIcon, getMessage, getMessageColor, getTitle, getTitleColor, setBackground, setBackground, setBackgroundColor, setCustomMessage, setCustomMessage, setCustomTitle, setCustomTitle, setIcon, setIcon, setIconAttribute, setMessage, setMessage, setMessageColor, setTitle, setTitle, setTitleColor, setView, setViewgetContextgetHeaderBackground, getHeaderDividerColor, getHeaderHeight, getHeaderIcon, isHeaderDividerShown, isHeaderShown, setHeaderBackground, setHeaderBackground, setHeaderBackgroundColor, setHeaderDividerColor, setHeaderHeight, setHeaderIcon, setHeaderIcon, showHeader, showHeaderDivideraddAllValidators, addValidator, getValidators, removeAllValidators, removeValidatorprotected AbstractButtonBarDialog(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 value. The resource id must correspond to a valid themepublic final android.widget.Button getButton(int whichButton)
ButtonBarDialogDecoratorgetButton in interface ButtonBarDialogDecoratorwhichButton - The identifier of the button, which should be returned, as an Integer value.
The identifier must either be DialogInterface.BUTTON_POSITIVE, DialogInterface.BUTTON_NEGATIVE or DialogInterface.BUTTON_NEUTRALButton or null, if the button is not shown or if the dialog has not been shown yetpublic final void setPositiveButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setPositiveButton in interface ButtonBarDialogDecoratortext - The text, which should be set, as an instance of the type CharSequence or
null, if no positive button should be shownlistener - The listener, which should be notified, when the positive button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final void setPositiveButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setPositiveButton in interface ButtonBarDialogDecoratorresourceId - The resource id of the text, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcelistener - The listener, which should be notified, when the positive button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final void setNegativeButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setNegativeButton in interface ButtonBarDialogDecoratortext - The text, which should be set, as an instance of the type CharSequence or
null, if no negative button should be shownlistener - The listener, which should be notified, when the negative button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final void setNegativeButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setNegativeButton in interface ButtonBarDialogDecoratorresourceId - The resource id of the text, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcelistener - The listener, which should be notified, when the negative button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final void setNeutralButton(java.lang.CharSequence text,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setNeutralButton in interface ButtonBarDialogDecoratortext - The text, which should be set, as an instance of the type CharSequence or
null, if no neutral button should be shownlistener - The listener, which should be notified, when the neutral button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final void setNeutralButton(int resourceId,
android.content.DialogInterface.OnClickListener listener)
ButtonBarDialogDecoratoronSaveInstanceState-method, because it is not serializable. Therefore this
method must be called again after configuration changes, e.g when the orientation of the
device has changed, in order to re-register the listener.setNeutralButton in interface ButtonBarDialogDecoratorresourceId - The resource id of the text, which should be set, as an Integer value. The
resource id must correspond to a valid string resourcelistener - The listener, which should be notified, when the neutral button is clicked, as an
instance of the type DialogInterface.OnClickListener or null, if no listener
should be notifiedpublic final boolean areButtonsStacked()
ButtonBarDialogDecoratorareButtonsStacked in interface ButtonBarDialogDecoratorpublic final void stackButtons(boolean stackButtons)
ButtonBarDialogDecoratorstackButtons in interface ButtonBarDialogDecoratorstackButtons - True, if the buttons of the dialog should be aligned vertically, false otherwisepublic final int getButtonTextColor()
ButtonBarDialogDecoratorgetButtonTextColor in interface ButtonBarDialogDecoratorInteger valuepublic final void setButtonTextColor(int color)
ButtonBarDialogDecoratorsetButtonTextColor in interface ButtonBarDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic final boolean isButtonBarDividerShown()
ButtonBarDialogDecoratorisButtonBarDividerShown in interface ButtonBarDialogDecoratorpublic final void showButtonBarDivider(boolean show)
ButtonBarDialogDecoratorshowButtonBarDivider in interface ButtonBarDialogDecoratorshow - True, if the divider, which is located above the dialog's buttons, should be show,
false otherwisepublic final int getButtonBarDividerColor()
ButtonBarDialogDecoratorgetButtonBarDividerColor in interface ButtonBarDialogDecoratorInteger valuepublic final void setButtonBarDividerColor(int color)
ButtonBarDialogDecoratorsetButtonBarDividerColor in interface ButtonBarDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic android.os.Bundle onSaveInstanceState()
onSaveInstanceState in class AbstractValidateableDialogpublic void onRestoreInstanceState(android.os.Bundle savedInstanceState)
onRestoreInstanceState in class AbstractValidateableDialogprotected void onAttachDecorators(android.view.View view)
AbstractMaterialDialogonAttachDecorators in class AbstractValidateableDialogview - 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 nullprotected void onDetachDecorators()
AbstractMaterialDialogonDetachDecorators in class AbstractValidateableDialog