feat(#3474): Move lock icon on ContactItem.kt, tweak layout. (#3487)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-10-16 15:38:16 -05:00 committed by GitHub
parent 1df58b2cae
commit 0c2d58bb9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,26 +102,29 @@ fun ContactItem(
colors = colors,
)
Column(modifier = Modifier.weight(1f)) {
Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween) {
Text(text = longName, modifier = Modifier.weight(1f))
Row(verticalAlignment = Alignment.CenterVertically) {
// Show unlock icon for broadcast with default PSK
val isBroadcast =
contact.contactKey.getOrNull(1) == '^' ||
contact.contactKey.endsWith("^all") ||
contact.contactKey.endsWith("^broadcast")
if (isBroadcast && channels != null) {
val channelIndex = contact.contactKey[0].digitToIntOrNull()
channelIndex?.let { index -> SecurityIcon(channels, index) }
Spacer(modifier = Modifier.width(8.dp))
}
Text(
text = lastMessageTime.orEmpty(),
color = MaterialTheme.colorScheme.onSurface,
fontSize = MaterialTheme.typography.labelLarge.fontSize,
modifier = Modifier.width(80.dp),
)
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
// Show unlock icon for broadcast with default PSK
val isBroadcast =
contact.contactKey.getOrNull(1) == '^' ||
contact.contactKey.endsWith("^all") ||
contact.contactKey.endsWith("^broadcast")
if (isBroadcast && channels != null) {
val channelIndex = contact.contactKey[0].digitToIntOrNull()
channelIndex?.let { index -> SecurityIcon(channels, index) }
}
Text(text = longName)
Spacer(modifier = Modifier.weight(1f))
Text(
text = lastMessageTime.orEmpty(),
color = MaterialTheme.colorScheme.onSurface,
fontSize = MaterialTheme.typography.labelLarge.fontSize,
modifier = Modifier.width(80.dp),
)
}
Row(
modifier = Modifier.fillMaxWidth().padding(top = 8.dp),