public class ListDialogDecorator extends AbstractDialogDecorator<ButtonBarDialog> implements ListDialogDecorator
| Constructor and Description |
|---|
ListDialogDecorator(ButtonBarDialog dialog)
Creates a new decorator, which allows to modify the view hierarchy of 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 |
onAttach(android.view.View view)
The method, which is invoked, when the decorator is attached to the view hierarchy.
|
protected void |
onDetach()
The method, which is invoked, when the decorator is detached from the view hierarchy.
|
void |
onRestoreInstanceState(android.os.Bundle savedInstanceState)
The method, which is invoked in order to restore the state, which has previously stored
within a bundle.
|
void |
onSaveInstanceState(android.os.Bundle outState)
The method, which is invoked in order to stores the decorator's state.
|
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.
|
attach, detach, getContext, getDialog, getViewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextpublic ListDialogDecorator(ButtonBarDialog dialog)
dialog - The dialog, whose view hierarchy should be modified by the dialog, as an instance of
the type ButtonBarDialog. The dialog may not be nullpublic 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 final void onSaveInstanceState(android.os.Bundle outState)
DialogDecoratoronSaveInstanceState in interface DialogDecoratoroutState - The bundle, the decorator's state should be stored within, as an instance of the
class Bundle. The bundle may not be nullpublic final void onRestoreInstanceState(android.os.Bundle savedInstanceState)
DialogDecoratoronRestoreInstanceState in interface DialogDecoratorsavedInstanceState - The bundle, which has been used to store the state, as an instance of the class
Bundle. The bundle may not be nullprotected final void onAttach(android.view.View view)
AbstractDialogDecoratoronAttach in class AbstractDialogDecorator<ButtonBarDialog>view - The root view of the dialog, which is modified by the decorator, as an instance of
the class View. The view may not be nullprotected final void onDetach()
AbstractDialogDecoratoronDetach in class AbstractDialogDecorator<ButtonBarDialog>