Skip to content
Vikram edited this page May 27, 2015 · 1 revision

Initial values for SublimePicker are passed through SublimeOptions.

Available options

  • setAnimateLayoutChanges(boolean animateLayoutChanges): provides layout animation using android.animation.LayoutTransition. The animations aren't great, but they do add a bit of fluidity to layout changes such as switching between pickers. Off by default.

  • setPickerToShow(Picker picker): supplied picker will be shown when SublimePicker is launched. It is an error to pass this method a picker that has been deactivated. Defaults to Picker.DATE_PICKER. So, if you deactivate Picker.DATE_PICKER, call this method to clear the default.

  • setDisplayOptions(int displayOptions): activate/deactivate picker(s) that you need/don't need. You can pass any combination of SublimeOptions.ACTIVATE_DATE_PICKER, SublimeOptions.ACTIVATE_TIME_PICKER & SublimeOptions.ACTIVATE_RECURRENCE_PICKER to this method. For example, to activate TimePicker & RecurrencePicker (but not DatePicker), use:

      mSublimeOptions.setDisplayOptions(SublimeOptions.ACTIVATE_TIME_PICKER 
                                     | SublimeOptions.ACTIVATE_RECURRENCE_PICKER);
    

    By default, all three pickers are active.

  • setDateParams(int year, int monthOfYear, int dayOfMonth): set initial date parameters

  • setDateRange(long minDate, long maxDate): if you only need to set a minDate (or maxDate), pass Long.MIN_VALUE for the other

  • setTimeParams(int hourOfDay, int minute, boolean is24HourView): set initial time parameters

  • setRecurrenceParams(String recurrenceRule): set recurrence rule

Clone this wiki locally