mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 08:23:00 +01:00
Show the entire member label on recipient details sheet.
This commit is contained in:
committed by
Greyson Parrelli
parent
5ec2877bcc
commit
7266c24354
@@ -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
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user