Search in sources :

Example 1 with RecurrencePickerDialog

use of com.android.calendar.recurrencepicker.RecurrencePickerDialog in project Etar-Calendar by Etar-Group.

the class EditEventView method onClick.

// This is called if the user clicks on one of the buttons: "Save",
// "Discard", or "Delete". This is also called if the user clicks
// on the "remove reminder" button.
@Override
public void onClick(View view) {
    if (view == mRruleButton) {
        Bundle b = new Bundle();
        b.putLong(RecurrencePickerDialog.BUNDLE_START_TIME_MILLIS, mStartTime.toMillis(false));
        b.putString(RecurrencePickerDialog.BUNDLE_TIME_ZONE, mStartTime.timezone);
        // TODO may be more efficient to serialize and pass in EventRecurrence
        b.putString(RecurrencePickerDialog.BUNDLE_RRULE, mRrule);
        FragmentManager fm = mActivity.getFragmentManager();
        RecurrencePickerDialog rpd = (RecurrencePickerDialog) fm.findFragmentByTag(FRAG_TAG_RECUR_PICKER);
        if (rpd != null) {
            rpd.dismiss();
        }
        rpd = new RecurrencePickerDialog();
        rpd.setArguments(b);
        rpd.setOnRecurrenceSetListener(EditEventView.this);
        rpd.show(fm, FRAG_TAG_RECUR_PICKER);
        return;
    }
    // This must be a click on one of the "remove reminder" buttons
    ConstraintLayout reminderItem = (ConstraintLayout) view.getParent();
    LinearLayout parent = (LinearLayout) reminderItem.getParent();
    parent.removeView(reminderItem);
    mReminderItems.remove(reminderItem);
    updateRemindersVisibility(mReminderItems.size());
    EventViewUtils.updateAddReminderButton(mView, mReminderItems, mModel.mCalendarMaxReminders);
}
Also used : FragmentManager(android.app.FragmentManager) RecurrencePickerDialog(com.android.calendar.recurrencepicker.RecurrencePickerDialog) Bundle(android.os.Bundle) LinearLayout(android.widget.LinearLayout) ConstraintLayout(androidx.constraintlayout.widget.ConstraintLayout)

Aggregations

FragmentManager (android.app.FragmentManager)1 Bundle (android.os.Bundle)1 LinearLayout (android.widget.LinearLayout)1 ConstraintLayout (androidx.constraintlayout.widget.ConstraintLayout)1 RecurrencePickerDialog (com.android.calendar.recurrencepicker.RecurrencePickerDialog)1