mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Improve rendering when sender does not have a display name.
This commit is contained in:
+11
-8
@@ -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,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user