From d29052eb47f79ebbc6756e60e073d16b6d87cc8a Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Mon, 13 Nov 2023 16:35:11 +0100 Subject: [PATCH] Add active call icon to room list summaries (#1792) Co-authored-by: ElementBot --- changelog.d/1158.feature | 1 + .../roomlist/impl/components/RoomSummaryRow.kt | 14 +++++++++++--- .../roomlist/impl/datasource/RoomListDataSource.kt | 1 + .../roomlist/impl/model/RoomListRoomSummary.kt | 1 + .../impl/model/RoomListRoomSummaryProvider.kt | 1 + .../libraries/matrix/api/roomlist/RoomSummary.kt | 1 + .../impl/roomlist/RoomSummaryDetailsFactory.kt | 1 + ...omSummaryRow-Day-8_8_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...omSummaryRow-Day-8_8_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...omSummaryRow-Day-8_8_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...omSummaryRow-Day-8_8_null_8,NEXUS_5,1.0,en].png | 3 +++ ...SummaryRow-Night-8_9_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...SummaryRow-Night-8_9_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...SummaryRow-Night-8_9_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...SummaryRow-Night-8_9_null_8,NEXUS_5,1.0,en].png | 3 +++ ...hResultContent-Day-9_9_null,NEXUS_5,1.0,en].png | 4 ++-- ...sultContent-Night-9_10_null,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...RoomListView-Day-2_2_null_9,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_0,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_1,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_2,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_3,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_4,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_5,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_7,NEXUS_5,1.0,en].png | 4 ++-- ...omListView-Night-2_3_null_9,NEXUS_5,1.0,en].png | 4 ++-- 33 files changed, 71 insertions(+), 51 deletions(-) create mode 100644 changelog.d/1158.feature create mode 100644 tests/uitests/src/test/snapshots/images/ui_S_t[f.roomlist.impl.components_RoomSummaryRow_null_RoomSummaryRow-Day-8_8_null_8,NEXUS_5,1.0,en].png create mode 100644 tests/uitests/src/test/snapshots/images/ui_S_t[f.roomlist.impl.components_RoomSummaryRow_null_RoomSummaryRow-Night-8_9_null_8,NEXUS_5,1.0,en].png diff --git a/changelog.d/1158.feature b/changelog.d/1158.feature new file mode 100644 index 0000000000..a3ce14a877 --- /dev/null +++ b/changelog.d/1158.feature @@ -0,0 +1 @@ +Add ongoing call indicator to rooms lists items. diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt index 2016cf5a6b..a437dd339c 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/components/RoomSummaryRow.kt @@ -172,14 +172,22 @@ private fun RowScope.LastMessageAndIndicatorRow(room: RoomListRoomSummary) { // Unread Row( + modifier = Modifier.height(16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, ) { + // Video call + if (room.hasOngoingCall) { + Icon( + modifier = Modifier.size(16.dp), + resourceId = CommonDrawables.ic_compound_video_call, + contentDescription = null, + tint = ElementTheme.colors.unreadIndicator, + ) + } NotificationIcon(room) if (room.hasUnread) { - UnreadIndicatorAtom( - modifier = Modifier.padding(vertical = 3.dp), - ) + UnreadIndicatorAtom() } } } diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/datasource/RoomListDataSource.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/datasource/RoomListDataSource.kt index 6a9c152af6..b8af0a60cc 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/datasource/RoomListDataSource.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/datasource/RoomListDataSource.kt @@ -161,6 +161,7 @@ class RoomListDataSource @Inject constructor( }.orEmpty(), avatarData = avatarData, notificationMode = roomSummary.details.notificationMode, + hasOngoingCall = roomSummary.details.hasOngoingCall, ) } null -> null diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummary.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummary.kt index bb3405c2d3..3a445e6cdc 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummary.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummary.kt @@ -33,4 +33,5 @@ data class RoomListRoomSummary constructor( val avatarData: AvatarData = AvatarData(id, name, size = AvatarSize.RoomListItem), val isPlaceholder: Boolean = false, val notificationMode: RoomNotificationMode? = null, + val hasOngoingCall: Boolean = false, ) diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt index f2db8a376c..2649704427 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/model/RoomListRoomSummaryProvider.kt @@ -40,6 +40,7 @@ open class RoomListRoomSummaryProvider : PreviewParameterProvider