Skip to content

Commit c961ef0

Browse files
style(mentions): vertically center mention chips in single liners
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 parent ab23609 commit c961ef0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/src/main/java/com/nextcloud/talk/ui/chat/MentionChip.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,18 @@ fun buildMentionInlineContent(
170170
val width = estimateMentionChipWidthInEm(mention.name, fontSizeSp)
171171
val heightDp = if (isMultilineLayout) CHIP_MULTILINE_HEIGHT_DP else CHIP_SINGLE_LINE_HEIGHT_DP
172172
val heightEm = heightDp / fontSizeSp
173+
val verticalAlign = if (isMultilineLayout) PlaceholderVerticalAlign.Bottom else PlaceholderVerticalAlign.Center
174+
val boxAlignment = if (isMultilineLayout) Alignment.BottomStart else Alignment.CenterStart
173175
return InlineTextContent(
174176
placeholder = Placeholder(
175177
width = width.em,
176178
height = heightEm.em,
177-
placeholderVerticalAlign = PlaceholderVerticalAlign.Bottom
179+
placeholderVerticalAlign = verticalAlign
178180
)
179181
) { _ ->
180182
Box(
181183
modifier = Modifier.fillMaxSize(),
182-
contentAlignment = Alignment.BottomStart
184+
contentAlignment = boxAlignment
183185
) {
184186
MentionChip(
185187
mention = mention,

0 commit comments

Comments
 (0)