fix(android): Auto-mirror back and forward arrows for RTL support 📟 #12227
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.
Addresses much of #12215
This PR changes UI elements from
ic_arrow_back
/ic_arrow_forward
to useic_action_back
andic_action_forward
layouts because the action layouts have theandroid:autoMirrored="true"
property to support right-to-left languages.For left-to-right languages, action_back points left, action_forward points to the right
For right-to-left languages, action_back points right, action_forward points to the left.
Current limitations to address on separate PRs:
User Testing
Setup - Choose one of the following two ways to test RTL strings:
a. On a modern Android device/emulator, Android Settings --> About emulated device --> Click on the "Build number" 7+ times to unlock developer options --> Reboot device
b. When the device is back on --> Android Settings --> System --> Languages --> System Languages --> "idiB-oduesP) cibarA)" [this is the psuedo-bidirectional Arabic locale"] --> drag this to the number 1 preferred language order
Screenshot
"Installed Languages" menu displayed in Arabic.
The "back arrow" in the title bar points to the right
The "forward arrow" for English keyboard points to the left