From 37d6c98d588c363a0ca7a83b9f977138925f0bc1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 24 Oct 2018 17:08:42 +0200 Subject: [PATCH] show the selected CalDAV calendars color at the event details screen --- .../calendar/activities/EventActivity.kt | 5 +++++ app/src/main/res/layout/activity_event.xml | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index 82e941837..495ad3658 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -621,6 +621,7 @@ class EventActivity : SimpleActivity() { event_type_holder.beVisibleIf(currentCalendar == null) event_caldav_calendar_divider.beVisibleIf(currentCalendar == null) event_caldav_calendar_email.beGoneIf(currentCalendar == null) + event_caldav_calendar_color.beGoneIf(currentCalendar == null) if (currentCalendar == null) { mEventCalendarId = STORED_LOCALLY_ONLY @@ -635,6 +636,10 @@ class EventActivity : SimpleActivity() { } } else { event_caldav_calendar_email.text = currentCalendar.accountName + + val calendarColor = dbHelper.getEventTypeWithCalDAVCalendarId(currentCalendar.id)?.color ?: currentCalendar.color + event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor) + event_caldav_calendar_name.apply { text = currentCalendar.displayName setPadding(paddingLeft, paddingTop, paddingRight, resources.getDimension(R.dimen.tiny_margin).toInt()) diff --git a/app/src/main/res/layout/activity_event.xml b/app/src/main/res/layout/activity_event.xml index 8d7b01b6c..eac7ec4f2 100644 --- a/app/src/main/res/layout/activity_event.xml +++ b/app/src/main/res/layout/activity_event.xml @@ -403,6 +403,17 @@ android:textSize="@dimen/meta_text_size" tools:text="hello@simplemobiletools.com"/> + + @@ -467,7 +479,6 @@ android:layout_width="match_parent" android:layout_height="1px" android:layout_below="@+id/event_type_holder" - android:layout_marginTop="@dimen/medium_margin" android:background="@color/divider_grey" android:importantForAccessibility="no"/>