From db598af28aa73cba9f6cf02ddd0c9b1bfcab9cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 14 Apr 2021 10:20:00 +0200 Subject: [PATCH] [UI] Add legend in event details dialog. --- .../ui/dialogs/event/EventDetailsDialog.kt | 6 ++++++ app/src/main/res/layout/dialog_event_details.xml | 14 ++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 22 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt index 664cc078..4feb1d53 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt @@ -104,6 +104,12 @@ class EventDetailsDialog( } catch (_: Exception) {} + b.legend.text = listOfNotNull( + if (event.addedManually) R.string.legend_event_added_manually else null, + if (event.isDone) R.string.legend_event_is_done else null + ).map { activity.getString(it) }.join("\n") + b.legend.isVisible = b.legend.text.isNotBlank() + b.typeColor.background?.setTintColor(event.eventColor) b.details = mutableListOf( diff --git a/app/src/main/res/layout/dialog_event_details.xml b/app/src/main/res/layout/dialog_event_details.xml index 7a77a813..a2fe00f5 100644 --- a/app/src/main/res/layout/dialog_event_details.xml +++ b/app/src/main/res/layout/dialog_event_details.xml @@ -105,9 +105,23 @@ + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6f3021e4..303100f2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1439,4 +1439,6 @@ Ustaw wydarzenia jako lekcje on-line Wybierz rodzaj wydarzeń Grupuj lekcje on-line na liście + {cmd-clipboard-edit-outline} wydarzenie dodane ręcznie + {cmd-check} oznaczono jako wykonane