Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL: ensure sender information are correctly rendered in the timeline #3681

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Oct 15, 2024

Content

Sender information must be rendered at top start of the bubble.

In RTL, the cropping of the bubble was not correct (first commit) and the sender info was not aligned correctly (second commit)

Motivation and context

Second point of #2865

Screenshots / GIFs

From TimelineItemEventRowTimestampPreview:

Before After
image image

Tests

  • Set the phone language to a RTL language (such as Persian, which is supported by the app), or force RTL in the developer options of the phone
  • Open a timeline and observe that sender informations are rendered correctly.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner October 15, 2024 08:46
@bmarty bmarty requested review from ganfra and removed request for a team October 15, 2024 08:46
@bmarty bmarty added the PR-Bugfix For bug fix label Oct 15, 2024
Copy link
Contributor

github-actions bot commented Oct 15, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/C4yp6f

@bmarty bmarty mentioned this pull request Oct 15, 2024
14 tasks
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.81%. Comparing base (8e8353c) to head (1127e6b).
Report is 36 commits behind head on develop.

Files with missing lines Patch % Lines
...ges/impl/timeline/components/MessageEventBubble.kt 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3681      +/-   ##
===========================================
- Coverage    82.81%   82.81%   -0.01%     
===========================================
  Files         1747     1747              
  Lines        41785    41789       +4     
  Branches      5109     5111       +2     
===========================================
+ Hits         34604    34607       +3     
  Misses        5365     5365              
- Partials      1816     1817       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the remarks :)

)
.clip(bubbleShape)
.combinedClickable(
onClick = onClick,
onLongClick = onLongClick,
indication = ripple(),
interactionSource = interactionSource
),
)
.onGloballyPositioned { coordinates ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using onGloballyPositioned is not really great for performance, also we already have the size in the drawWithContent scope.

@@ -112,7 +120,7 @@ fun MessageEventBubble(
drawCircle(
color = Color.Black,
center = Offset(
x = 0f,
x = if (isRtl) contentWidthPx else 0f,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just x = if(isRtl) size.width else 0f should be good!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, I do not know why I did not see that yesterday. Thanks!

Copy link

sonarcloud bot commented Oct 16, 2024

@bmarty bmarty merged commit 95941fc into develop Oct 16, 2024
25 of 26 checks passed
@bmarty bmarty deleted the feature/bma/rtlIssue branch October 16, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants