Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 1.1 KB

README.md

File metadata and controls

21 lines (18 loc) · 1.1 KB

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.