From 9efb94ee065e8e3e0b7b5e0f143220e1421ccd20 Mon Sep 17 00:00:00 2001 From: Agnieszka C <85929121+Aga-C@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:58:03 +0100 Subject: [PATCH] Squashed multiple lines of description on event list (#1379) --- .../simplemobiletools/calendar/pro/adapters/DayEventsAdapter.kt | 2 +- .../simplemobiletools/calendar/pro/adapters/EventListAdapter.kt | 2 +- .../calendar/pro/adapters/EventListWidgetAdapter.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/DayEventsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/DayEventsAdapter.kt index 761ee0395..0f28c4ef2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/DayEventsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/DayEventsAdapter.kt @@ -89,7 +89,7 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList, r event_item_time.text = "${event_item_time.text} - ${Formatter.getTimeFromTS(context, event.endTS)}" } - event_item_description.text = if (replaceDescriptionWithLocation) event.location else event.description + event_item_description.text = if (replaceDescriptionWithLocation) event.location else event.description.replace("\n", " ") event_item_description.beVisibleIf(displayDescription && event_item_description.text.isNotEmpty()) event_item_color_bar.background.applyColorFilter(event.color) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListAdapter.kt index 7218d3c1d..57a56591f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListAdapter.kt @@ -147,7 +147,7 @@ class EventListAdapter( } } - event_item_description.text = if (replaceDescription) listEvent.location else listEvent.description + event_item_description.text = if (replaceDescription) listEvent.location else listEvent.description.replace("\n", " ") event_item_description.beVisibleIf(displayDescription && event_item_description.text.isNotEmpty()) event_item_color_bar.background.applyColorFilter(listEvent.color) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt index 8cefec365..a2a00e3c5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt @@ -92,7 +92,7 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi setText(R.id.event_item_time, timeText) // we cannot change the event_item_color_bar rules dynamically, so do it like this - val descriptionText = if (replaceDescription) item.location else item.description + val descriptionText = if (replaceDescription) item.location else item.description.replace("\n", " ") if (displayDescription && descriptionText.isNotEmpty()) { setText(R.id.event_item_time, "$timeText\n$descriptionText") }