vikramkakkar / SublimePicker

A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.
Apache License 2.0
2.31k stars 407 forks source link

set default for RecurrenceRule #28

Open a-eslampanah opened 8 years ago

a-eslampanah commented 8 years ago

I want to set default for mRecurrenceRule and options before show dialog by SublimeOptions via setRecurrenceParams but it hasnot effect. has it a solution?

vikramkakkar commented 8 years ago

What is the value that is being passed to SublimeOptions#setRecurrenceRule(String)?

a-eslampanah commented 8 years ago

i first run Recurrence Dialog then store result from onDateTimeRecurrenceSet,parameter recurrenceRule. when now i want to open Recurrence Dialog with previous rule,but dialog will reset whth default values, and cannot process input recurrenceRule. i view the source and see that method setRecurrenceRule has attribute unused,that's mean this feature is not implement. please help me to implement this

vikramkakkar commented 8 years ago

i view the source and see that method setRecurrenceRule has attribute unused,that's mean this feature is not implement.

No, that annotation is there to suppress lint warning about this method being unused - true since this is a library & most methods in SublimeOptions will be called by the client.

The issue was that the recurrence rule set in SublimeOptions was not being passed onto the recurrence picker.

I've fixed this, and pushed an update. Please update your gradle dependency as per the readme.

Usage:

sublimeOptions.setRecurrenceParams(RecurrenceOption.CUSTOM, ".... recurrence rule ....");

// For any option other that CUSTOM
sublimeOptions.setRecurrenceParams(RecurrenceOption.YEARLY, null);