AndroidRecurringCalendar

Adds support for EventAndExceptions data objects to AndroidCalendar.

There are basically two methods for inserting an exception event:

  1. Insert it using Events.CONTENT_EXCEPTION_URI – then the calendar provider will take care of validating and cleaning up various fields, however it's then not possible to set some sync fields (all sync fields but Events.SYNC_DATA1, Events.SYNC_DATA3 and Events.SYNC_DATA7 are filtered for some reason.) It also supports splitting the main event ("exception from this date"). Usually this method is used by calendar apps.

  2. Insert it directly as normal event (using Events.CONTENT_URI). In this case Events.ORIGINAL_SYNC_ID must be set to the Events._SYNC_ID of the original event so that the calendar provider can associate the exception with the main event. It's not enough to set Events.ORIGINAL_ID!

This class only uses the second method because it needs to support all sync fields.

Constructors

Link copied to clipboard
constructor(calendar: AndroidCalendar)

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Inserts an event and all its exceptions. Input data is first cleaned up using cleanUp.

Link copied to clipboard

Deletes an event and all its potential exceptions.

Link copied to clipboard
fun getById(mainEventId: Long): EventAndExceptions?

Retrieves an event and its exceptions from the content provider (associated by Events.ORIGINAL_ID).

Link copied to clipboard
fun updateEventAndExceptions(id: Long, eventAndExceptions: EventAndExceptions): Long

Updates an event and all its exceptions. Input data is first cleaned up using cleanMainEvent and cleanException.