Repository navigation
fix(messenger): centre system message text on the info glyph - #1803
Merged
Merged
Conversation
The glyph is centred in an 18sp box beside the first line, but Compose's default line height style trims the first line's top, so the caption sat about 3dp above the glyph. Centre the text in untrimmed 18sp line boxes, which is what iOS's ChatSystemMessageCell does with its baseline offset. Rows grow by about 3dp to match iOS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
System message text sat about 3dp above the info glyph beside it.
SystemMessageRowcentres the glyph in a box one caption line (18sp) tall. Compose's defaultLineHeightStyletrims the top of the first line, so the text's first line box was shorter than the glyph's and the text started higher.The text now uses
LineHeightStyle(Alignment.Center, Trim.None): every line keeps its full 18sp box with the text centred in it. That matches iOS'sChatSystemMessageCell, which fixes the line height at 18pt and centres the font with a baseline offset. Rows get about 3dp taller, which brings them in line with iOS.Checked with a Robolectric render of one-line and wrapped messages, before and after.