Add icon for "Mark as read" and "Mark as unread" action.

This commit is contained in:
Benoit Marty 2024-07-05 09:49:42 +02:00 committed by Benoit Marty
parent 08c66cf2df
commit 4c135a1111

View file

@ -96,36 +96,35 @@ private fun RoomListModalBottomSheetContent(
} }
) )
if (contextMenu.markAsUnreadFeatureFlagEnabled) { if (contextMenu.markAsUnreadFeatureFlagEnabled) {
if (contextMenu.hasNewContent) {
ListItem( ListItem(
headlineContent = { headlineContent = {
Text( Text(
text = stringResource( text = stringResource(id = R.string.screen_roomlist_mark_as_read),
id = if (contextMenu.hasNewContent) {
R.string.screen_roomlist_mark_as_read
} else {
R.string.screen_roomlist_mark_as_unread
}
),
style = MaterialTheme.typography.bodyLarge, style = MaterialTheme.typography.bodyLarge,
) )
}, },
modifier = Modifier.clickable { onClick = onRoomMarkReadClick,
if (contextMenu.hasNewContent) {
onRoomMarkReadClick()
} else {
onRoomMarkUnreadClick()
}
},
/* TODO Design
leadingContent = ListItemContent.Icon( leadingContent = ListItemContent.Icon(
iconSource = IconSource.Vector( iconSource = IconSource.Vector(CompoundIcons.MarkAsRead())
CompoundIcons.Settings,
contentDescription = stringResource(id = CommonStrings.common_settings)
)
), ),
*/
style = ListItemStyle.Primary, 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( ListItem(
headlineContent = { headlineContent = {