diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt index 15dbfda93..b651b6432 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/extensions/Context.kt @@ -242,7 +242,8 @@ fun Context.getCalDAVCalendars(): List { CalendarContract.Calendars._ID, CalendarContract.Calendars.CALENDAR_DISPLAY_NAME, CalendarContract.Calendars.ACCOUNT_NAME, - CalendarContract.Calendars.OWNER_ACCOUNT) + CalendarContract.Calendars.OWNER_ACCOUNT, + CalendarContract.Calendars.CALENDAR_COLOR) var cursor: Cursor? = null try { @@ -252,7 +253,8 @@ fun Context.getCalDAVCalendars(): List { val displayName = cursor.getStringValue(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME) val accountName = cursor.getStringValue(CalendarContract.Calendars.ACCOUNT_NAME) val ownerName = cursor.getStringValue(CalendarContract.Calendars.OWNER_ACCOUNT) - val calendar = CalDAVCalendar(id, displayName, accountName, ownerName) + val color = cursor.getIntValue(CalendarContract.Calendars.CALENDAR_COLOR) + val calendar = CalDAVCalendar(id, displayName, accountName, ownerName, color) calendars.add(calendar) } } finally { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/models/CalDAVCalendar.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/models/CalDAVCalendar.kt index 6c5232043..0703960fd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/models/CalDAVCalendar.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/models/CalDAVCalendar.kt @@ -1,3 +1,3 @@ package com.simplemobiletools.calendar.models -data class CalDAVCalendar(val id: Long, val displayName: String, val accountName: String, val ownerName: String) +data class CalDAVCalendar(val id: Long, val displayName: String, val accountName: String, val ownerName: String, val color: Int)