Merge pull request #1224 from vector-im/feature/bma/displayNameColor

Iterate on display name and avatar color
This commit is contained in:
Benoit Marty 2023-09-05 17:24:26 +02:00 committed by GitHub
commit 4e8ce6c091
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
249 changed files with 707 additions and 477 deletions

View file

@ -75,6 +75,7 @@ import io.element.android.features.messages.impl.timeline.model.event.TimelineIt
import io.element.android.features.messages.impl.timeline.model.event.aTimelineItemImageContent
import io.element.android.features.messages.impl.timeline.model.event.aTimelineItemPollContent
import io.element.android.features.messages.impl.timeline.model.event.aTimelineItemTextContent
import io.element.android.libraries.designsystem.colors.avatarColors
import io.element.android.libraries.designsystem.components.EqualWidthColumn
import io.element.android.libraries.designsystem.components.avatar.Avatar
import io.element.android.libraries.designsystem.components.avatar.AvatarData
@ -327,6 +328,7 @@ private fun MessageSenderInformation(
) {
val avatarStrokeColor = MaterialTheme.colorScheme.background
val avatarSize = senderAvatar.size.dp
val avatarColors = avatarColors(senderAvatar.id)
Box(
modifier = modifier
) {
@ -344,13 +346,13 @@ private fun MessageSenderInformation(
}
// Content
Row {
Avatar(senderAvatar)
Avatar(senderAvatar, initialAvatarColors = avatarColors)
Spacer(modifier = Modifier.width(4.dp))
Text(
text = sender,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.primary,
color = avatarColors.foreground,
style = ElementTheme.typography.fontBodyMdMedium,
)
}