use of com.codetroopers.betterpickers.calendardatepicker.CalendarDatePickerDialogFragment in project android-betterpickers by code-troopers.
the class RecurrencePickerDialogFragment method onClick.
// Implements OnClickListener interface
// EndDate button
// Done button
@Override
public void onClick(View v) {
if (mEndDateTextView == v) {
if (mDatePickerDialog != null) {
mDatePickerDialog.dismiss();
}
mDatePickerDialog = new CalendarDatePickerDialogFragment();
mDatePickerDialog.setOnDateSetListener(this);
mDatePickerDialog.setPreselectedDate(mModel.endDate.year, mModel.endDate.month, mModel.endDate.monthDay);
mDatePickerDialog.setFirstDayOfWeek(Utils.getFirstDayOfWeekAsCalendar(getActivity()));
mDatePickerDialog.show(getFragmentManager(), FRAG_TAG_DATE_PICKER);
} else if (mDoneButton == v) {
String rrule;
if (mModel.recurrenceState == RecurrenceModel.STATE_NO_RECURRENCE) {
rrule = null;
} else {
copyModelToEventRecurrence(mModel, mRecurrence);
rrule = mRecurrence.toString();
}
mRecurrenceSetListener.onRecurrenceSet(rrule);
dismiss();
}
}
Aggregations