Search in sources :

Example 26 with CalendarDatePickerDialogFragment

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();
    }
}
Also used : CalendarDatePickerDialogFragment(com.codetroopers.betterpickers.calendardatepicker.CalendarDatePickerDialogFragment)

Aggregations

CalendarDatePickerDialogFragment (com.codetroopers.betterpickers.calendardatepicker.CalendarDatePickerDialogFragment)26 View (android.view.View)14 TextView (android.widget.TextView)13 Button (android.widget.Button)11 MonthAdapter (com.codetroopers.betterpickers.calendardatepicker.MonthAdapter)5 DateTime (org.joda.time.DateTime)5 RadialTimePickerDialogFragment (com.codetroopers.betterpickers.radialtimepicker.RadialTimePickerDialogFragment)3 Calendar (java.util.Calendar)3 AdapterView (android.widget.AdapterView)2 Time (ve.com.abicelis.remindy.model.Time)2 DialogInterface (android.content.DialogInterface)1 Nullable (android.support.annotation.Nullable)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 SparseArray (android.util.SparseArray)1 OnDialogDismissListener (com.codetroopers.betterpickers.OnDialogDismissListener)1 NumberPickerBuilder (com.codetroopers.betterpickers.numberpicker.NumberPickerBuilder)1 BigDecimal (java.math.BigDecimal)1