From 7266c243542afca3febde16ddeb26c6028b3f536 Mon Sep 17 00:00:00 2001 From: jeffrey-signal Date: Wed, 4 Mar 2026 10:11:40 -0500 Subject: [PATCH] Show the entire member label on recipient details sheet. --- .../securesms/groups/memberlabel/MemberLabelPill.kt | 13 ++++++++----- .../groups/memberlabel/MemberLabelPillView.kt | 6 ++++-- .../RecipientBottomSheetDialogFragment.kt | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPill.kt b/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPill.kt index c1e70058cd..1f4d7c1221 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPill.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPill.kt @@ -50,7 +50,8 @@ fun MemberLabelPill( text: String, tintColor: Color, modifier: Modifier = defaultModifier, - textStyle: TextStyle = MemberLabelPill.textStyleCompact + textStyle: TextStyle = MemberLabelPill.textStyleCompact, + maxLines: Int = 1 ) { val isDark = isSystemInDarkTheme() val backgroundColor = tintColor.copy(alpha = if (isDark) 0.32f else 0.10f) @@ -67,7 +68,8 @@ fun MemberLabelPill( textColor = textColor, backgroundColor = backgroundColor, modifier = modifier, - textStyle = textStyle + textStyle = textStyle, + maxLines = maxLines ) } @@ -81,9 +83,10 @@ fun MemberLabelPill( textColor: Color, backgroundColor: Color, modifier: Modifier = defaultModifier, - textStyle: TextStyle = MemberLabelPill.textStyleCompact + textStyle: TextStyle = MemberLabelPill.textStyleCompact, + maxLines: Int = 1 ) { - val shape = RoundedCornerShape(percent = 50) + val shape = if (maxLines > 1) RoundedCornerShape(24.dp) else RoundedCornerShape(percent = 50) Row( modifier = Modifier @@ -112,7 +115,7 @@ fun MemberLabelPill( text = annotatedText, inlineContent = inlineContent, color = textColor, - maxLines = 1, + maxLines = maxLines, overflow = TextOverflow.Ellipsis ) } diff --git a/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPillView.kt b/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPillView.kt index 45521e8570..fd48e890c1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPillView.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/memberlabel/MemberLabelPillView.kt @@ -56,7 +56,8 @@ class MemberLabelPillView : AbstractComposeView { text = label.displayText, tintColor = tintColor, modifier = Modifier.padding(horizontal = style.horizontalPadding, vertical = style.verticalPadding), - textStyle = style.textStyle() + textStyle = style.textStyle(), + maxLines = style.maxLines ) } } @@ -64,7 +65,8 @@ class MemberLabelPillView : AbstractComposeView { data class Style( val horizontalPadding: Dp = 12.dp, val verticalPadding: Dp = 2.dp, - val textStyle: @Composable () -> TextStyle = { MemberLabelPill.textStyleNormal } + val textStyle: @Composable () -> TextStyle = { MemberLabelPill.textStyleNormal }, + val maxLines: Int = 1 ) { companion object { @JvmField diff --git a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.kt b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.kt index 23519c0051..6b72f7808b 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/recipients/ui/bottomsheet/RecipientBottomSheetDialogFragment.kt @@ -111,7 +111,9 @@ class RecipientBottomSheetDialogFragment : FixedRoundedCornerBottomSheetDialogFr val avatar: AvatarView = view.findViewById(R.id.rbs_recipient_avatar) val fullName: TextView = view.findViewById(R.id.rbs_full_name) - val memberLabelView: MemberLabelPillView = view.findViewById(R.id.rbs_member_label) + val memberLabelView: MemberLabelPillView = view.findViewById(R.id.rbs_member_label).apply { + style = MemberLabelPillView.Style(maxLines = Int.MAX_VALUE) + } val aboutView: TextView = view.findViewById(R.id.rbs_about) val nickname: TextView = view.findViewById(R.id.rbs_nickname_button) val blockButton: TextView = view.findViewById(R.id.rbs_block_button)