Squashed multiple lines of description on event list (#1379)

This commit is contained in:
Agnieszka C 2021-12-14 11:58:03 +01:00
parent 3c6e853156
commit 9efb94ee06
3 changed files with 3 additions and 3 deletions

View File

@ -89,7 +89,7 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
event_item_time.text = "${event_item_time.text} - ${Formatter.getTimeFromTS(context, event.endTS)}" 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_description.beVisibleIf(displayDescription && event_item_description.text.isNotEmpty())
event_item_color_bar.background.applyColorFilter(event.color) event_item_color_bar.background.applyColorFilter(event.color)

View File

@ -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_description.beVisibleIf(displayDescription && event_item_description.text.isNotEmpty())
event_item_color_bar.background.applyColorFilter(listEvent.color) event_item_color_bar.background.applyColorFilter(listEvent.color)

View File

@ -92,7 +92,7 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
setText(R.id.event_item_time, timeText) setText(R.id.event_item_time, timeText)
// we cannot change the event_item_color_bar rules dynamically, so do it like this // 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()) { if (displayDescription && descriptionText.isNotEmpty()) {
setText(R.id.event_item_time, "$timeText\n$descriptionText") setText(R.id.event_item_time, "$timeText\n$descriptionText")
} }