From f5ad2abdd3914ede3bcbb267b6fdb3c123d325c2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 5 Jul 2024 09:49:42 +0200 Subject: [PATCH] Add icon for "Mark as read" and "Mark as unread" action. --- .../roomlist/impl/RoomListContextMenu.kt | 59 +++++++++---------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt index 582c5e083b..01e370bc1a 100644 --- a/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt +++ b/features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt @@ -96,36 +96,35 @@ private fun RoomListModalBottomSheetContent( } ) if (contextMenu.markAsUnreadFeatureFlagEnabled) { - ListItem( - headlineContent = { - Text( - text = stringResource( - id = if (contextMenu.hasNewContent) { - R.string.screen_roomlist_mark_as_read - } else { - R.string.screen_roomlist_mark_as_unread - } - ), - style = MaterialTheme.typography.bodyLarge, - ) - }, - modifier = Modifier.clickable { - if (contextMenu.hasNewContent) { - onRoomMarkReadClick() - } else { - onRoomMarkUnreadClick() - } - }, - /* TODO Design - leadingContent = ListItemContent.Icon( - iconSource = IconSource.Vector( - CompoundIcons.Settings, - contentDescription = stringResource(id = CommonStrings.common_settings) - ) - ), - */ - style = ListItemStyle.Primary, - ) + if (contextMenu.hasNewContent) { + ListItem( + headlineContent = { + Text( + text = stringResource(id = R.string.screen_roomlist_mark_as_read), + style = MaterialTheme.typography.bodyLarge, + ) + }, + onClick = onRoomMarkReadClick, + leadingContent = ListItemContent.Icon( + iconSource = IconSource.Vector(CompoundIcons.MarkAsRead()) + ), + style = ListItemStyle.Primary, + ) + } else { + ListItem( + headlineContent = { + Text( + text = stringResource(id = R.string.screen_roomlist_mark_as_unread), + style = MaterialTheme.typography.bodyLarge, + ) + }, + onClick = onRoomMarkUnreadClick, + leadingContent = ListItemContent.Icon( + iconSource = IconSource.Vector(CompoundIcons.MarkAsUnread()) + ), + style = ListItemStyle.Primary, + ) + } } ListItem( headlineContent = {