Skip to content

Commit 8abd7ef

Browse files
Merge pull request #6150 from nextcloud/style/noid/mentionVerticalAlignment
Vertically center mention chips in single liners
2 parents fc6e205 + c961ef0 commit 8abd7ef

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
@@ -175,16 +175,18 @@ fun buildMentionInlineContent(
175175
val width = estimateMentionChipWidthInEm(mention.name, fontSizeSp)
176176
val heightDp = if (isMultilineLayout) CHIP_MULTILINE_HEIGHT_DP else CHIP_SINGLE_LINE_HEIGHT_DP
177177
val heightEm = heightDp / fontSizeSp
178+
val verticalAlign = if (isMultilineLayout) PlaceholderVerticalAlign.Bottom else PlaceholderVerticalAlign.Center
179+
val boxAlignment = if (isMultilineLayout) Alignment.BottomStart else Alignment.CenterStart
178180
return InlineTextContent(
179181
placeholder = Placeholder(
180182
width = width.em,
181183
height = heightEm.em,
182-
placeholderVerticalAlign = PlaceholderVerticalAlign.Bottom
184+
placeholderVerticalAlign = verticalAlign
183185
)
184186
) { _ ->
185187
Box(
186188
modifier = Modifier.fillMaxSize(),
187-
contentAlignment = Alignment.BottomStart
189+
contentAlignment = boxAlignment
188190
) {
189191
MentionChip(
190192
mention = mention,

0 commit comments

Comments
 (0)