Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Closes #7861: position text based on layout direction, not on text directionality #28340

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

mavduevskiy
Copy link
Contributor

@mavduevskiy mavduevskiy commented Dec 29, 2022

There is a number of visual issues coming from positioning text according to its direction, ignoring the layout direction. Setting a RTL language makes the design inconsistent, because English text would still appear LTR. Considering orientation over locale could make the UI more consistent. This change is aiming for that.

Was also considering android:textDirection="locale" solution, but it lead to edge cases, where the first strong character of the string would override the direction, so "This time search in:" would become ":This time search in" in RTL mode.

Is part of a general push for more RTL support. This patch is focused on the text positioning only. Also fixes this and this bugs.

Old New
saved_accounts_old saved_accounts_new
opened_tabs_old opened_tabs_new
search_engines_old search_engines_new

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

QA

  • QA Needed

To download an APK when reviewing a PR (after all CI tasks finished running):

  1. Click on Checks at the top of the PR page.
  2. Click on the firefoxci-taskcluster group on the left to expand all tasks.
  3. Click on the build-debug task.
  4. Click on View task in Taskcluster in the new DETAILS section.
  5. The APK links should be on the right side of the screen, named for each CPU architecture.

GitHub Automation

Fixes #7861

@mavduevskiy mavduevskiy requested review from a team as code owners December 29, 2022 17:00
@mavduevskiy mavduevskiy changed the title Closes #7861: position text based on layout direction, but text directionality Closes #7861: position text based on layout direction, not on text directionality Dec 29, 2022
Copy link
Contributor

@sarah541 sarah541 left a comment

Choose a reason for hiding this comment

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

We will want to add this to PrivateThemeBase as well

@mavduevskiy
Copy link
Contributor Author

@sarah541
a keen eye you have! thanks, Sarah!

@sarah541
Copy link
Contributor

sarah541 commented Jan 3, 2023

Although this does solve the bugs mentioned, it may have introduced a new one (please test more and let know). When setting an RTL language, everything looks good, but changing it back to an LTR one, causes the start position same as RTL start position. Screenshots may help better understand.
|

@mavduevskiy
Copy link
Contributor Author

@sarah541
I believe you are mentioning a bug I am fixing here: layout isn't redrawn after switching between RTL/LTR without restarting the app.

It wasn't introduced with this patch though, sadly it looks like switching between RTL/LTR never worked correctly.

@sarah541
Copy link
Contributor

This looks good to me!

@mavduevskiy mavduevskiy added the pr:needs-landing PRs that are ready to land [Will be merged by Mergify] label Jan 10, 2023
@mergify mergify bot merged commit 48163ef into mozilla-mobile:main Jan 10, 2023
@mavduevskiy mavduevskiy added eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged and removed eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged labels Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr:needs-landing PRs that are ready to land [Will be merged by Mergify]
Projects
None yet
2 participants