From 455b80857d24331190e19726a09a5ac97f0d0c73 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 21 Jan 2024 15:52:00 +0100 Subject: [PATCH] If possible, display the current partecipants count in `RoomListItem` --- .../java/eu/steffo/twom/composables/main/RoomListItem.kt | 6 +++++- app/src/main/res/values/strings.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/steffo/twom/composables/main/RoomListItem.kt b/app/src/main/java/eu/steffo/twom/composables/main/RoomListItem.kt index b8df074..47ce9a6 100644 --- a/app/src/main/java/eu/steffo/twom/composables/main/RoomListItem.kt +++ b/app/src/main/java/eu/steffo/twom/composables/main/RoomListItem.kt @@ -96,7 +96,11 @@ fun RoomListItem( supportingContent = { val count = roomSummary.joinedMembersCount if (count != null) { - Text(stringResource(R.string.main_partecipants, count)) + if (count != 1) { + Text(stringResource(R.string.main_partecipants, count)) + } else { + Text(stringResource(R.string.main_partecipant, count)) + } } }, ) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c587292..582608e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -86,4 +86,5 @@ Something went wrong while sending the invite: %1$s Editing %1$s %1$d partecipants + %1$d partecipant \ No newline at end of file