@@ -627,6 +627,9 @@ private fun ParticipantsSectionHeader(state: ConversationInfoUiState, callbacks:
627627private sealed class ParticipantAvatarContent {
628628 data class Url (val url : String ) : ParticipantAvatarContent()
629629 data class Res (@DrawableRes val resId : Int ) : ParticipantAvatarContent()
630+
631+ /* * Renders the icon on a themed surfaceVariant background circle (equivalent to themePlaceholderAvatar). */
632+ data class ThemedRes (@DrawableRes val resId : Int ) : ParticipantAvatarContent()
630633 data class FirstLetter (val letter : String ) : ParticipantAvatarContent()
631634}
632635
@@ -651,9 +654,9 @@ private fun buildParticipantAvatarContent(
651654 true
652655 )
653656 )
654- Participant .ActorType .GROUPS -> ParticipantAvatarContent .Res (R .drawable.ic_avatar_group )
655- Participant .ActorType .CIRCLES -> ParticipantAvatarContent .Res (R .drawable.ic_avatar_team_small)
656- Participant .ActorType .PHONES -> ParticipantAvatarContent .Res (R .drawable.ic_phone_small)
657+ Participant .ActorType .GROUPS -> ParticipantAvatarContent .ThemedRes (R .drawable.ic_avatar_group_small )
658+ Participant .ActorType .CIRCLES -> ParticipantAvatarContent .ThemedRes (R .drawable.ic_avatar_team_small)
659+ Participant .ActorType .PHONES -> ParticipantAvatarContent .ThemedRes (R .drawable.ic_phone_small)
657660 Participant .ActorType .GUESTS , Participant .ActorType .EMAILS -> {
658661 val name = participant.displayName
659662 if (! name.isNullOrBlank()) {
@@ -725,6 +728,21 @@ private fun ParticipantAvatarImage(
725728 modifier = modifier.clip(CircleShape )
726729 )
727730 }
731+ is ParticipantAvatarContent .ThemedRes -> {
732+ Box (
733+ modifier = modifier
734+ .clip(CircleShape )
735+ .background(MaterialTheme .colorScheme.surfaceVariant),
736+ contentAlignment = Alignment .Center
737+ ) {
738+ Icon (
739+ painter = painterResource(avatarContent.resId),
740+ contentDescription = stringResource(R .string.avatar),
741+ tint = MaterialTheme .colorScheme.onSurfaceVariant,
742+ modifier = Modifier .fillMaxSize()
743+ )
744+ }
745+ }
728746 is ParticipantAvatarContent .FirstLetter -> {
729747 Box (
730748 modifier = modifier
@@ -814,22 +832,25 @@ private fun participantEffectiveStatus(participant: Participant): String {
814832
815833@Composable
816834private fun ParticipantNameRow (displayName : String , roleLabel : String , nameColor : Color ) {
817- Row (verticalAlignment = Alignment . Bottom ) {
835+ Row {
818836 Text (
819837 text = displayName,
820838 style = MaterialTheme .typography.bodyLarge,
821839 color = nameColor,
822840 maxLines = 1 ,
823841 overflow = TextOverflow .Ellipsis ,
824- modifier = Modifier .weight(1f , fill = false )
842+ modifier = Modifier
843+ .weight(1f , fill = false )
844+ .alignByBaseline()
825845 )
826846 if (roleLabel.isNotEmpty()) {
827847 Text (
828848 text = " ($roleLabel )" ,
829- style = MaterialTheme .typography.bodySmall ,
849+ style = MaterialTheme .typography.bodyLarge ,
830850 color = MaterialTheme .colorScheme.onSurfaceVariant,
831851 maxLines = 1 ,
832- overflow = TextOverflow .Ellipsis
852+ overflow = TextOverflow .Ellipsis ,
853+ modifier = Modifier .alignByBaseline()
833854 )
834855 }
835856 }
@@ -1039,6 +1060,15 @@ private fun previewState(): ConversationInfoUiState {
10391060 ),
10401061 isOnline = false
10411062 )
1063+ val dave = ParticipantModel (
1064+ participant = Participant (
1065+ actorType = Participant .ActorType .CIRCLES ,
1066+ actorId = " eng-circle" ,
1067+ displayName = " Engineering Circle" ,
1068+ type = Participant .ParticipantType .USER
1069+ ),
1070+ isOnline = false
1071+ )
10421072 return ConversationInfoUiState (
10431073 isLoading = false ,
10441074 displayName = " Jane Doe" ,
@@ -1075,7 +1105,7 @@ private fun previewState(): ConversationInfoUiState {
10751105 isConversationLocked = false ,
10761106 showLockConversation = true ,
10771107 showParticipants = true ,
1078- participants = listOf (alice, bob, carol),
1108+ participants = listOf (alice, bob, carol, dave ),
10791109 showAddParticipants = true ,
10801110 showListBans = true ,
10811111 showArchiveConversation = true ,
0 commit comments