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