Merge pull request #5888 from element-hq/feature/bma/roomListIcons
RoomSummary: move the icon related to the last message state on start of the message.
This commit is contained in:
commit
e1361d8677
28 changed files with 76 additions and 82 deletions
|
|
@ -121,7 +121,6 @@ internal fun RoomSummaryRow(
|
|||
) {
|
||||
NameAndTimestampRow(
|
||||
name = room.name,
|
||||
latestEvent = room.latestEvent,
|
||||
timestamp = room.timestamp,
|
||||
isHighlighted = room.isHighlighted
|
||||
)
|
||||
|
|
@ -138,7 +137,6 @@ internal fun RoomSummaryRow(
|
|||
) {
|
||||
NameAndTimestampRow(
|
||||
name = room.name,
|
||||
latestEvent = room.latestEvent,
|
||||
timestamp = null,
|
||||
isHighlighted = room.isHighlighted
|
||||
)
|
||||
|
|
@ -214,7 +212,6 @@ private fun RoomSummaryScaffoldRow(
|
|||
@Composable
|
||||
private fun NameAndTimestampRow(
|
||||
name: String?,
|
||||
latestEvent: LatestEvent,
|
||||
timestamp: String?,
|
||||
isHighlighted: Boolean,
|
||||
modifier: Modifier = Modifier
|
||||
|
|
@ -236,29 +233,6 @@ private fun NameAndTimestampRow(
|
|||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
// Picto
|
||||
when (latestEvent) {
|
||||
is LatestEvent.Sending -> {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Icon(
|
||||
modifier = Modifier.size(16.dp),
|
||||
imageVector = CompoundIcons.Time(),
|
||||
contentDescription = stringResource(CommonStrings.common_sending),
|
||||
tint = ElementTheme.colors.iconTertiary,
|
||||
)
|
||||
}
|
||||
is LatestEvent.Error -> {
|
||||
Spacer(modifier = Modifier.width(4.dp))
|
||||
Icon(
|
||||
modifier = Modifier.size(16.dp),
|
||||
imageVector = CompoundIcons.ErrorSolid(),
|
||||
// The last message contains the error.
|
||||
contentDescription = null,
|
||||
tint = ElementTheme.colors.iconCriticalPrimary,
|
||||
)
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
}
|
||||
// Timestamp
|
||||
Text(
|
||||
|
|
@ -303,7 +277,6 @@ private fun MessagePreviewAndIndicatorRow(
|
|||
) {
|
||||
Row(
|
||||
modifier = modifier.fillMaxWidth(),
|
||||
horizontalArrangement = spacedBy(28.dp)
|
||||
) {
|
||||
if (room.isTombstoned) {
|
||||
Text(
|
||||
|
|
@ -317,6 +290,16 @@ private fun MessagePreviewAndIndicatorRow(
|
|||
)
|
||||
} else {
|
||||
if (room.latestEvent is LatestEvent.Error) {
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.padding(top = 2.dp)
|
||||
.size(16.dp),
|
||||
imageVector = CompoundIcons.ErrorSolid(),
|
||||
// The last message contains the error.
|
||||
contentDescription = null,
|
||||
tint = ElementTheme.colors.iconCriticalPrimary,
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = stringResource(CommonStrings.common_message_failed_to_send),
|
||||
|
|
@ -327,6 +310,17 @@ private fun MessagePreviewAndIndicatorRow(
|
|||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
} else {
|
||||
if (room.latestEvent is LatestEvent.Sending) {
|
||||
Icon(
|
||||
modifier = Modifier
|
||||
.padding(top = 2.dp)
|
||||
.size(16.dp),
|
||||
imageVector = CompoundIcons.Time(),
|
||||
contentDescription = stringResource(CommonStrings.common_sending),
|
||||
tint = ElementTheme.colors.iconTertiary,
|
||||
)
|
||||
Spacer(modifier = Modifier.width(6.dp))
|
||||
}
|
||||
val messagePreview = room.latestEvent.content()
|
||||
val annotatedMessagePreview = messagePreview as? AnnotatedString ?: AnnotatedString(text = messagePreview.orEmpty().toString())
|
||||
Text(
|
||||
|
|
@ -340,7 +334,7 @@ private fun MessagePreviewAndIndicatorRow(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
// Call and unread
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4013ad25e9f4e38109e7ee49921814adc8ec5e4952c8f8d4d6946a4badf67081
|
||||
size 41513
|
||||
oid sha256:5ad4cbbad7f8d12579ea2336dbe90519d164baf1ba5ca1d1398f598c699a37b3
|
||||
size 41814
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9d035c3d696dae89026dbcc8cfc918a98cc8bb8b3f79548b57d36b96b29f097f
|
||||
size 59908
|
||||
oid sha256:b9a6f816acf13335c15e188cb6d9d240aa9f19e76f80c65cb6ce5d02036b4d92
|
||||
size 60017
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1720068dd3f0b75076ef81642d680f00e52f7162247beb30dc515fb74c25cf2a
|
||||
size 41164
|
||||
oid sha256:2cffbce8a793651437dc5ff93c697d859df047a71a6a128996c41af918ad18fc
|
||||
size 41499
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bf2cedb0979d0eb916df2a1810c7d872d159214b0e26d5b3a353001dfed0aa06
|
||||
size 58935
|
||||
oid sha256:ca660f44ee031e98540134d3b37743dbb893566a6a8359dfbd4dd4da87bc2e83
|
||||
size 59128
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:761e963499f97f21b5c5b8b80e5d75092fbc4305371bcc413f595b503890d511
|
||||
size 13085
|
||||
oid sha256:c125c71ef07cc228ea24bd34a43091e0728d529d2303e44684529f32beaa09f8
|
||||
size 13113
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:de31aa3dbb9c9427189621d35022211220197de8ed8584f36801eb99d613f0b1
|
||||
size 13728
|
||||
oid sha256:c7b78a9d066b454130ad08bfa035a2afafa6ec1711d88921a7fabb84a73b01ee
|
||||
size 13616
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:929d7eb7ea27b4638a8bb71093f6c0d7c01da4d7bf563ebaf31c91657f3db7fb
|
||||
size 20629
|
||||
oid sha256:2a8c23e9560ba89e226390862ab0b724465ebb2ab7c20e5a41f2df72b9ee76a1
|
||||
size 21024
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1f7327f29c9236b549d7f5037e3483e487a23902c5c30bd20a7a4bc0e6c13bec
|
||||
size 13009
|
||||
oid sha256:a49cc5e58070d5af3fb905076a41ce5cb0bf77eda4d34550d8e7ac1f4c771472
|
||||
size 12981
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f92a70303d515a135eb87eac344dc4a974183da8773524a48f790b31a70338e8
|
||||
size 13528
|
||||
oid sha256:3377bf16f847083f340218bd6bf4f4f3290d354c06193a808402f26ee34ea8a7
|
||||
size 13432
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:112dcba335114372a39a531be0ad6350f1bcdffe03d4c6033d2a4799715bed6d
|
||||
size 20300
|
||||
oid sha256:ff0df80592079fadfbf82b192ed79e9684dce58d146bf2e571a04c6784a9e6bc
|
||||
size 20696
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:10d68a9d1c5913fe9c14edd6d3663b7692f9c9031dd08205ad290c4d1f1593bf
|
||||
size 43973
|
||||
oid sha256:de647a2d609bb2ac37875767780dccfa34d47b68da504b59ebb27e2f8d989452
|
||||
size 44250
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6fb9912ee3b7489424e9f364610cb4f9c7c3276e17f7e6fe75c2be7a3cd84bf4
|
||||
size 43434
|
||||
oid sha256:1decbfcf1afc6d2f827d570ef0145674ab1f598ce375b95331ca83975793509e
|
||||
size 43762
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a3530f2d4ba4b189c7e40c19548fe1d44fea844505ed411cd476eb41add5aac5
|
||||
size 122437
|
||||
oid sha256:88dff52e06c62a7df91c08ed0237068a2e8bcdfd5f83426a52cf7a3097ee8cfa
|
||||
size 122935
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:60f321d5352e1966b44e13b4b9e56da3f2cfd14e5eb4a468b61b1939799d364a
|
||||
size 61182
|
||||
oid sha256:580c70e645e954e9e3d29a68aa46b1eae3a82651eb5e419eb92cba48bf7baaf1
|
||||
size 61515
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bf7d32047c608340c06edfb8ade3cc8b92858eaa763fedafa915c16439657fc2
|
||||
size 88205
|
||||
oid sha256:821cb6a2068561375d0988d4ba5404e52411a6d9b73cefbe1a6bd7bc6d467673
|
||||
size 88367
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:abf95575cbd55470c798accf988bc6a509daea71eded4108857595993873df4e
|
||||
size 81038
|
||||
oid sha256:f9f5fef39d80aacb9666deeea43e4df48f7c70231bd8ec41edf2f3eed5f0aa42
|
||||
size 81149
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:60f321d5352e1966b44e13b4b9e56da3f2cfd14e5eb4a468b61b1939799d364a
|
||||
size 61182
|
||||
oid sha256:580c70e645e954e9e3d29a68aa46b1eae3a82651eb5e419eb92cba48bf7baaf1
|
||||
size 61515
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:60f321d5352e1966b44e13b4b9e56da3f2cfd14e5eb4a468b61b1939799d364a
|
||||
size 61182
|
||||
oid sha256:580c70e645e954e9e3d29a68aa46b1eae3a82651eb5e419eb92cba48bf7baaf1
|
||||
size 61515
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:60f321d5352e1966b44e13b4b9e56da3f2cfd14e5eb4a468b61b1939799d364a
|
||||
size 61182
|
||||
oid sha256:580c70e645e954e9e3d29a68aa46b1eae3a82651eb5e419eb92cba48bf7baaf1
|
||||
size 61515
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:196cad6f5c3d01d52c88713526848d7905b59b49866f27f6e420df0b6b8f9e73
|
||||
size 80857
|
||||
oid sha256:a5a68b4d8951b7c516561d538c5d328a84948c66af7eb7c80ac77cd005620cf2
|
||||
size 80977
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7e9b4b3247cf2f540866286de61760a45956d8179891aeb669b4763bdd29393d
|
||||
size 57993
|
||||
oid sha256:37660e7c0626ae3e5a8404fdc7e57e41d43750abb4004572ffd9c25a501c668e
|
||||
size 58325
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a7ff4652d94dec6bc98b3f1dea0d182576c7bfc72e39f232d224046e6492b55e
|
||||
size 83764
|
||||
oid sha256:541740cdd54ef7b9a868c1409330a6ca7417bce9f022b22c3d395ac9b215d470
|
||||
size 83939
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cb1d9b5143703ec9a8035e11374c7e56ce4d3f836005632a109e5556b141c59b
|
||||
size 77098
|
||||
oid sha256:a44897f23fc0e6a90779fe96638c560973caf7dbb9a7c92ec4d2f5b56de3ddcc
|
||||
size 77280
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7e9b4b3247cf2f540866286de61760a45956d8179891aeb669b4763bdd29393d
|
||||
size 57993
|
||||
oid sha256:37660e7c0626ae3e5a8404fdc7e57e41d43750abb4004572ffd9c25a501c668e
|
||||
size 58325
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7e9b4b3247cf2f540866286de61760a45956d8179891aeb669b4763bdd29393d
|
||||
size 57993
|
||||
oid sha256:37660e7c0626ae3e5a8404fdc7e57e41d43750abb4004572ffd9c25a501c668e
|
||||
size 58325
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7e9b4b3247cf2f540866286de61760a45956d8179891aeb669b4763bdd29393d
|
||||
size 57993
|
||||
oid sha256:37660e7c0626ae3e5a8404fdc7e57e41d43750abb4004572ffd9c25a501c668e
|
||||
size 58325
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:101d0425024c30f2dce8b6d91ed2416fc115c4bf3719fd6c46093705ba4ef772
|
||||
size 76985
|
||||
oid sha256:49ea33ae74532c350b4176355203561cfc5eb79c93c4993d6ffb0cf933f8ad2f
|
||||
size 77167
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue