Skip to content
Vikram edited this page May 27, 2015 · 4 revisions

With the following, you can create a SublimePicker initialized with current date, time & DOES_NOT_REPEAT recurrence option.

Listener Adapter

Create an instance of SublimeListenerAdapter:

SublimeListenerAdapter mListener = new SublimeListenerAdapter() {
    @Override
    public void onCancelled() {
        // Handle click on `Cancel` button
    }

    @Override
    public void onDateTimeRecurrenceSet(SublimePicker sublimePicker,
                                        int year, int monthOfYear, int dayOfMonth,
                                        int hourOfDay, int minute,
                                        SublimeRecurrencePicker.RecurrenceOption recurrenceOption,
                                        String recurrenceRule) {
        // Handle click on `OK` button
    }
};

Picker

Inside a suitable method, initialize SublimePicker:

SublimePicker mSublimePicker;

....

mSublimePicker = (SublimePicker) findViewById(R.id.sublime_picker);
// Passing `null` to apply default options
mSublimePicker.initializePicker(null, mListener);
Clone this wiki locally