Skip to content

Android implemenation is missing "eventColor" retrieval. #74

@kkohler2

Description

@kkohler2

From what I can tell, you can retrieve all fields on Android for a calendar's events, except "eventColor".

If necessary, use conditional defines if event color is not implemented on other platforms. This is an easy change:

In CalendarEvent.Shared.cs, add the following to CalendarEvent class
public int EventColor { get; internal set; }

In CalendarStore.Android.cs, Update definition of eventColums to add:
CalendarContract.Events.InterfaceConsts.EventColor

In return statement for ToEvent(ICursor cursor, List projection), add setting EventColor like this:
EventColor = cursor.GetInt(projection.IndexOf(
CalendarContract.Events.InterfaceConsts.EventColor))

It may be better to define EventColor as an unsigned int or better yet, define an enum to match the Android calendar colors, then map the calendar value to the enum on retrieval and enum to color for setting.

I only have interest in retrieving the event color, not setting it, so setting the event color is not shown here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions