-
-
Notifications
You must be signed in to change notification settings - Fork 18
CustomListDialog
Philipp Niedermayer edited this page Sep 14, 2018
·
10 revisions
extends CustomViewDialog
Extend this class to create a dialog with a custom ListView.
-
Choice mode
.choiceMode(int mode)
Sets the mode to one ofNO_CHOICE
,SINGLE_CHOICE
,SINGLE_CHOICE_DIRECT
orMULTI_CHOICE
. -
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 by position(s) or id(s) inSINGLE_CHOICE
andMULTI_CHOICE
mode 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, 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
protected abstract ListAdapter onCreateAdapter()
Create and return your custom Adapter here.
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).
The Bundle returned from this dialog will contain the following extras depending on the choice
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