Skip to content

Custom android spinner with multi-selection and an optional 'none' select.

Notifications You must be signed in to change notification settings

prsidhu/MultiSelectSpinner

Repository files navigation

This is a multi-selection spinner where you can add a 'None' option as well.

 

The spinner supports following methods:

  1. setItems(): Set adapter items using an array/list of strings.
  2. setSelection(): Set selected items on the spinner. You can pass either of the following parameters:
    • Array of strings
    • List of strings
    • (int) index of the selection
    • (int) array of indexes
  3. getSelectedStrings(): Get the selected items as a string. Retrun type is a List.
  4. getSelectedIndices(): Get the selected indexes as a List of integers.

None Option

None option can be included by setting the property 'hasNoneOption' as true.

This does not add the 'None' item to the spinner. You will have to add that manually to your array/List while setting up the adapter. This allows you to control the text of the 'none' option. The first item in the array/list will be considered for the 'none' option. you can add any string for this item: None, [Select One], etc.

About

Custom android spinner with multi-selection and an optional 'none' select.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages