Improve rendering when sender does not have a display name.
This commit is contained in:
parent
7bbdecc7a8
commit
b12a9ff2b9
1 changed files with 11 additions and 8 deletions
|
|
@ -192,23 +192,26 @@ private fun SenderRow(
|
|||
.weight(1f),
|
||||
) {
|
||||
// Name
|
||||
val bestName = mediaInfo.senderName ?: mediaInfo.senderId?.value.orEmpty()
|
||||
val avatarColors = AvatarColorsProvider.provide(id)
|
||||
Text(
|
||||
modifier = Modifier.clipToBounds(),
|
||||
text = mediaInfo.senderName.orEmpty(),
|
||||
text = bestName,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
color = avatarColors.foreground,
|
||||
style = ElementTheme.typography.fontBodyMdMedium,
|
||||
)
|
||||
// Id
|
||||
Text(
|
||||
text = mediaInfo.senderId?.value.orEmpty(),
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
)
|
||||
if (!mediaInfo.senderName.isNullOrEmpty()) {
|
||||
Text(
|
||||
text = mediaInfo.senderId?.value.orEmpty(),
|
||||
color = ElementTheme.colors.textSecondary,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
style = ElementTheme.typography.fontBodyMdRegular,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue