Browse Source

Merge pull request #3144 from element-hq/feature/bma/markAsReadIcon

Add icon for "Mark as read" and "Mark as unread" actions.
pull/3149/head
ganfra 3 months ago committed by GitHub
parent
commit
ddcb17f27e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 59
      features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt
  2. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_0_en.png
  3. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_1_en.png
  4. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_2_en.png
  5. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_0_en.png
  6. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_1_en.png
  7. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_2_en.png
  8. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_3_en.png
  9. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_4_en.png
  10. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_5_en.png
  11. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_3_en.png
  12. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_4_en.png
  13. 4
      tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_5_en.png

59
features/roomlist/impl/src/main/kotlin/io/element/android/features/roomlist/impl/RoomListContextMenu.kt

@ -96,36 +96,35 @@ private fun RoomListModalBottomSheetContent( @@ -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 = {

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_0_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f7249fe5316ce5b2db50489bef2d2ce95d8328507410548e8f6bcb9b33104d2c
size 18545
oid sha256:87ce5ffee7e77cf6c67fe2918604d901755897739a7aa250adc85f8dca8fa384
size 19027

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_1_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bc916f49b9eec8c1da8525ad86a6cb806c8b9fd4af5d18c32691433bb152a11e
size 20350
oid sha256:177ebd3790437dad70044a183be5f109e457e7be2ef297bee9a214f41f136d54
size 20824

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Day_2_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11a0303a1d1f885db2dbda1a770518602c0ead94baf5500a3c06a4482c095a88
size 20615
oid sha256:bfd039feb28f9322719e4508c8fdc3a723deda4b5ab5f5035b668d764e398e99
size 21087

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_0_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:46a75f785463c85ab9a6038669cdd41d64dc043eca222f6029ef3b51bc1014c6
size 17952
oid sha256:5f89e40f49b0d0b9167aad620842f75005c9b37ca52c86bd0c902b79e387bd14
size 18330

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_1_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:06c03db06ec5ecb8e66b60beefb8ecc1ebcb820d2aa1dd9ea6dd2e294bc2b62f
size 19654
oid sha256:55c2e188b78a4019955cbf765dde70b771b94972939fe785c4134f6f2cb258b6
size 20042

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListModalBottomSheetContent_Night_2_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:54d7136e55a632186446badaab12be68afb9a062deb8433c5f6f1a0685653097
size 19856
oid sha256:22a0bd0eafdbbaa00b48d120b36cb048dd73b8ddaf39235bb146d79a84898c52
size 20243

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_3_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:daae8460b864ca17688a7e01165787f0c2610b82ff5e56645d03a3a32f4dc62d
size 22263
oid sha256:1745dfe97efbb62bc1bcc0a6e019e48e07dbc474396d9d58e11784522e519049
size 22733

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_4_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f73427a7770fa810299e156191e475cc70c0d19538dfa9c472f79e30b71230ab
size 22000
oid sha256:50a54a812331ec421e5b111a2aac07e0a75474d750bcd65f78d05c5485b028b1
size 22474

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Day_5_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84ecc8f273245781423c398495913cb770513d9401e9522d5a58cdf5ec360d26
size 19900
oid sha256:69e7b908f96969480ea4502f54f63f3066f1ef3c67171404f2aec294c25d7e3b
size 20358

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_3_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f8405c8fb37bf9021b15e03bf5744d7021ff47d9133e302025b35602c2063f0a
size 20397
oid sha256:0c5474b5be24946927efb2c6bf7a67a5ea378a63e16714ebe0a4cfbf76794bdf
size 20775

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_4_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ddfa75b7c5332287cb498d769eee8ede8f234b0347c552c6435aedcfcd626039
size 20170
oid sha256:43d72cf8272c38c6646c19e876f109d3e22f9aa91bd39af9a78bd15cc47bbf82
size 20542

4
tests/uitests/src/test/snapshots/images/features.roomlist.impl_RoomListView_Night_5_en.png

@ -1,3 +1,3 @@ @@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e08c05bf0c42b2b546c3dc3a8573f2a3294cf63059c495cf284b7302228b3e7
size 18202
oid sha256:4fc6ca5ca4298f69e1a036c164a9a832ebf9595f6ec92d81243d90ddb1cbc1a6
size 18591

Loading…
Cancel
Save