-
-
Notifications
You must be signed in to change notification settings - Fork 18
CustomListDialog
extends CustomViewDialog, Full API reference
Extend this class to create a dialog with a custom ListView.
-
Choice mode
.choiceMode(int mode)
Defines the behaviour when items are selected by setting the mode to one of-
NO_CHOICE- items can not be selected -
SINGLE_CHOICE- only one item can be selected at a time -
SINGLE_CHOICE_DIRECT- selecting an item closes the dialog as if the positive button was pressed -
MULTI_CHOICE- multiple items can be (un-)selected
-
-
Choice preset
.choicePreset(int position)
.choicePreset(List<Integer> positions)
.choicePreset(int[] positions)
.choiceIdPreset(long id)
.choiceIdPreset(List<Long> ids)
.choiceIdPreset(long[] ids)
Defines the initially checked item(s) by position(s) or id(s) inSINGLE_CHOICEandMULTI_CHOICEmode respectively. -
Control choice count
.choiceMin(int count)
.choiceMax(int count)
Defines minimum required and maximum allowed number of checked items inMULTI_CHOICE-mode -
Filter
.filterable(boolean enabled)When enabled, a search box appears at the top, so the user can filter the list by searching for a keyword. -
Grid layout
.grid()
Enables the grid-layout
.gridNumColumn(int numColumns)
Defines the number of columns in the grid
.gridColumnWidth(@DimenRes int columnWidthDimenResId)
Defines the with of the columns in the grid -
Show / hide divider
.divider(boolean show)
Show or hide divider between list items
protected abstract ListAdapter onCreateAdapter()Overwrite this method to create and return your custom Adapter here. See SimpleListDialog for an example.
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id)Overwrite these methods to react on clicks and long clicks on list items (optional).
See Receiving results from SimpleDialog.
The extras Bundle returned will contain the following keys depending on the choice type:
ArrayList<Integer> SELECTED_POSITIONS // Selected Positions (except in `NO_CHOICE`-mode)
long[] SELECTED_IDS // Selected ID's (only present if the Adapter provides stable ids)
int SELECTED_SINGLE_POSITION // Selected Position (only for `SINGLE_CHOICE`- and `SINGLE_CHOICE_DIRECT`-mode)
long SELECTED_SINGLE_ID // Selected ID (only present if the Adapter provides stable ids)Javadoc API
Screenshot gallery
Styling dialogs with themes
Fullscreen dialogs
SimpleDialog
CustomViewDialog
CustomListDialog
SimpleCheckDialog
SimpleColorDialog
SimpleColorWheelDialog
SimpleDateDialog
SimpleEMailDialog
SimpleFormDialog
SimpleImageDialog
SimpleInputDialog
SimpleListDialog
SimplePinDialog
SimpleProgressDialog
SimpleTimeDialog