From 5a014ba410ed3b4a39bfaffee68e3c4e080ff88b Mon Sep 17 00:00:00 2001 From: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:35:48 +0400 Subject: [PATCH] multiplatform: show admin and owner roles in the conversation (#4455) --- .../chat/simplex/common/views/chat/ChatView.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index 0cd33d659b..5578180ff8 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -1025,10 +1025,21 @@ fun BoxWithConstraintsScope.ChatItemsList( horizontalAlignment = Alignment.Start ) { if (cItem.content.showMemberName) { + val memberNameStyle = SpanStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary) + val memberNameString = if (memCount == 1 && member.memberRole > GroupMemberRole.Member) { + buildAnnotatedString { + withStyle(memberNameStyle.copy(fontWeight = FontWeight.Medium)) { append(member.memberRole.text) } + append(" ") + withStyle(memberNameStyle) { append(memberNames(member, prevMember, memCount)) } + } + } else { + buildAnnotatedString { + withStyle(memberNameStyle) { append(memberNames(member, prevMember, memCount)) } + } + } Text( - memberNames(member, prevMember, memCount), + memberNameString, Modifier.padding(start = MEMBER_IMAGE_SIZE + 10.dp), - style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary), maxLines = 2 ) }