Show the entire member label on recipient details sheet.

This commit is contained in:
jeffrey-signal
2026-03-04 10:11:40 -05:00
committed by Greyson Parrelli
parent 5ec2877bcc
commit 7266c24354
3 changed files with 15 additions and 8 deletions

View File

@@ -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
)
}

View File

@@ -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

View File

@@ -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<MemberLabelPillView>(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)