public abstract class AbstractListDialog extends AbstractButtonBarDialog implements ListDialog
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 |
AbstractListDialog(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 list items.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getItemColor()
Returns the color of the list items of the dialog.
|
android.widget.ListAdapter |
getListAdapter()
Returns the adapter of the list view, which is contained by the dialog.
|
android.widget.ListView |
getListView()
Returns the list view, which is contained by the dialog.
|
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 |
setAdapter(android.widget.ListAdapter adapter,
android.content.DialogInterface.OnClickListener listener)
Sets the adapter, which provides the items, which should be shown by the dialog.
|
void |
setItemColor(int color)
Sets the color of the list items of the dialog.
|
void |
setItems(java.lang.CharSequence[] items,
android.content.DialogInterface.OnClickListener listener)
Sets the items, which should be shown by the dialog.
|
void |
setItems(int resourceId,
android.content.DialogInterface.OnClickListener listener)
Sets the items, which should be shown by the dialog.
|
void |
setMultiChoiceItems(java.lang.CharSequence[] items,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
Sets the selectable items, which should be shown by the dialog.
|
void |
setMultiChoiceItems(int resourceId,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
Sets the selectable items, which should be shown by the dialog.
|
void |
setMultiChoiceItems(android.widget.ListAdapter adapter,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
Sets the adapter, which provides the selectable items, which should be shown by the dialog.
|
void |
setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener listener)
Sets the listener, which should be notified, when an item, which is shown by the dialog is
selected.
|
void |
setSingleChoiceItems(java.lang.CharSequence[] items,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
Sets the selectable items, which should be shown by the dialog.
|
void |
setSingleChoiceItems(int resourceId,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
Sets the selectable items, which should be shown by the dialog.
|
void |
setSingleChoiceItems(android.widget.ListAdapter adapter,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
Sets the adapter, which provides the selectable items, which should be shown by the dialog.
|
areButtonsStacked, getButton, getButtonBarDividerColor, getButtonTextColor, isButtonBarDividerShown, setButtonBarDividerColor, setButtonTextColor, setNegativeButton, setNegativeButton, setNeutralButton, setNeutralButton, setPositiveButton, setPositiveButton, showButtonBarDivider, stackButtonsaddAllValidators, 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, removeValidatorareButtonsStacked, getButton, getButtonBarDividerColor, getButtonTextColor, isButtonBarDividerShown, setButtonBarDividerColor, setButtonTextColor, setNegativeButton, setNegativeButton, setNeutralButton, setNeutralButton, setPositiveButton, setPositiveButton, showButtonBarDivider, stackButtonsprotected AbstractListDialog(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.ListView getListView()
ListDialogDecoratorgetListView in interface ListDialogDecoratorListView or null, if the dialog does not show any list items or has not been shown yetpublic final android.widget.ListAdapter getListAdapter()
ListDialogDecoratorgetListAdapter in interface ListDialogDecoratorListAdapter or null, if the dialog does not show any list itemspublic final int getItemColor()
ListDialogDecoratorgetItemColor in interface ListDialogDecoratorInteger valuepublic final void setItemColor(int color)
ListDialogDecoratorsetItemColor in interface ListDialogDecoratorcolor - The color, which should be set, as an Integer valuepublic final void setItems(java.lang.CharSequence[] items,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setItems in interface ListDialogDecoratoritems - The items, which should be set, as an array of the type CharSequence. The
items may not be nulllistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setItems(int resourceId,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setItems in interface ListDialogDecoratorresourceId - The resource id of the items, which should be set, as an Integer value. The
resource id must correspond to a valid array resourcelistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setAdapter(android.widget.ListAdapter adapter,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-method, because they are 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-set the adapter and re-register the listener.setAdapter in interface ListDialogDecoratoradapter - The adapter, which should be set, as an instance of the type ListAdapter. The
adapter may not be nulllistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setSingleChoiceItems(java.lang.CharSequence[] items,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setSingleChoiceItems in interface ListDialogDecoratoritems - The items, which should be set, as an array of the type CharSequence. The
items may not be nullcheckedItem - The index of the item, which should be selected by default, as an Integer
value or -1, if no item should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setSingleChoiceItems(int resourceId,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setSingleChoiceItems in interface ListDialogDecoratorresourceId - The resource id of the items, which should be set, as an Integer value. The
resource id must correspond to a valid array resourcecheckedItem - The index of the item, which should be selected by default, as an Integer
value or -1, if no item should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setSingleChoiceItems(android.widget.ListAdapter adapter,
int checkedItem,
android.content.DialogInterface.OnClickListener listener)
ListDialogDecoratoronSaveInstanceState-method, because they are 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-set the adapter and re-register the listener.setSingleChoiceItems in interface ListDialogDecoratoradapter - The adapter, which should be set, as an instance of the type ListAdapter. The
adapter may not be nullcheckedItem - The index of the item, which should be selected by default, as an Integer
value or -1, if no item should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnClickListener or null, if no listener should be
notifiedpublic final void setMultiChoiceItems(java.lang.CharSequence[] items,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setMultiChoiceItems in interface ListDialogDecoratoritems - The items, which should be set, as an array of the type CharSequence. The
items may not be nullcheckedItems - An array, which contains, whether the items, which correspond to the corresponding
indices, should be selected by default, or not, as a Boolean array or null,
if no items should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnMultiChoiceClickListener or null, if no listener
should be notifiedpublic final void setMultiChoiceItems(int resourceId,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
ListDialogDecoratoronSaveInstanceState-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.setMultiChoiceItems in interface ListDialogDecoratorresourceId - The resource id of the items, which should be set, as an Integer value. The
resource id must correspond to a valid array resourcecheckedItems - An array, which contains, whether the items, which correspond to the corresponding
indices, should be selected by default, or not, as a Boolean array or null,
if no items should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnMultiChoiceClickListener or null, if no listener
should be notifiedpublic final void setMultiChoiceItems(android.widget.ListAdapter adapter,
boolean[] checkedItems,
android.content.DialogInterface.OnMultiChoiceClickListener listener)
ListDialogDecoratoronSaveInstanceState-method, because they are 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-set the adapter and re-register the listener.setMultiChoiceItems in interface ListDialogDecoratoradapter - The adapter, which should be set, as an instance of the type ListAdapter. The
adapter may not be nullcheckedItems - An array, which contains, whether the items, which correspond to the corresponding
indices, should be selected by default, or not, as a Boolean array or null,
if no items should be selected by defaultlistener - The listener, which should be notified, when an item is clicked, as an instance of
the type DialogInterface.OnMultiChoiceClickListener or null, if no listener
should be notifiedpublic final void setOnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener listener)
ListDialogDecoratoronSaveInstanceState-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.setOnItemSelectedListener in interface ListDialogDecoratorlistener - The listener, which should be set, as an instance of the type AdapterView.OnItemSelectedListener or null, if no listener should be notifiedpublic android.os.Bundle onSaveInstanceState()
onSaveInstanceState in class AbstractButtonBarDialogpublic void onRestoreInstanceState(android.os.Bundle savedInstanceState)
onRestoreInstanceState in class AbstractButtonBarDialogprotected void onAttachDecorators(android.view.View view)
AbstractMaterialDialogonAttachDecorators in class AbstractButtonBarDialogview - 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 AbstractButtonBarDialog