Picker - shannah/CodeRAD GitHub Wiki
<picker>
• javadoc
Picker is a component and API that allows either popping up a spinner or using the native picker API when applicable. This is quite important for some platforms where the native spinner behavior is very hard to replicate.
It includes several different "flavours", and there is a specialized alias XML tag for each flavour.
Note
|
Use the PickerPropertyView <radPicker> instead if you want to bind the picker to a view model property.
|
Use the <picker strings="…">
variant to create a picker to choose between a set of strings.
<picker strings="csv:Red, Green, Blue" />
![StringPickerField](https://github.com/shannah/CodeRAD/wiki/images/StringPickerField.png)
![StringPIckerPopup](https://github.com/shannah/CodeRAD/wiki/images/StringPIckerPopup.png)
Tip
|
The Picker myPicker = new Picker();
myPicker.setStrings(new String[]{"Red", "Green", "Blue"}); |
Use the <datePicker>
tag for a picker that allows the user to select a date..
<datePicker/>
![DatePickerField](https://github.com/shannah/CodeRAD/wiki/images/DatePickerField.png)
![DatePickerPopup](https://github.com/shannah/CodeRAD/wiki/images/DatePickerPopup.png)
User the <timePicker>
tag for a picker that allows the user to a select a time.
<timePicker/>
![TimePickerField](https://github.com/shannah/CodeRAD/wiki/images/TimePickerField.png)
![TimePickerPopup](https://github.com/shannah/CodeRAD/wiki/images/TimePickerPopup.png)
Use the <dateTimePicker>
for a picker that allows the user to select both a date and time.
<dateTimePicker/>
![DateTimePickerField](https://github.com/shannah/CodeRAD/wiki/images/DateTimePickerField.png)
![DateTimePickerPopup](https://github.com/shannah/CodeRAD/wiki/images/DateTimePickerPopup.png)
Use the <calendarPicker>
tag for a picker that allows the user to select a date using a calendar.
<calendarPicker/>
![CalendarPickerFieldAndPopup](https://github.com/shannah/CodeRAD/wiki/images/CalendarPickerFieldAndPopup.png)
Use the <durationPicker>
tag for a picker that allows the user to select a duration in minutes and seconds.
<durationPicker/>
![DurationPickerPopup](https://github.com/shannah/CodeRAD/wiki/images/DurationPickerPopup.png)
Use the <durationHours>
tag for a picker that allows the user to select a duration in hours.
<durationHoursPicker/>
![DurationHoursPickerPopup](https://github.com/shannah/CodeRAD/wiki/images/DurationHoursPickerPopup.png)
See Picker javadocs for a full list of properties. All "setters" can be set using XML attributes.
<?xml version="1.0" encoding="UTF-8" ?>
<y safeArea="true" scrollableY="true" xsi:noNamespaceSchemaLocation="PickerSamples.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<title>Picker Samples</title>
<spanLabel>This page demonstrates unbound pickers.</spanLabel>
<spanLabel>For pickers bound to models see see: </spanLabel>
<button rad-href="#RADPickerSamples">RAD Picker Samples</button>
<label>Pick a color</label>
<picker strings="csv:Red, Green, Blue" />
<label>Datepicker</label>
<datePicker/>
<label>Timepicker</label>
<timePicker/>
<label>Date and Time picker</label>
<dateTimePicker/>
<label>Calendar Picker</label>
<calendarPicker/>
<label>Duration Picker</label>
<durationPicker/>
<label>Duration Hours Picker</label>
<durationHoursPicker/>
<label>Duration Minutes Picker</label>
<durationMinutesPicker/>
</y>