react-native
react-native copied to clipboard
Set and require android:supportsRtl="true" for RTL layout
Summary:
Android originated without RTL support. When RTL support was added, Applications needed to set android:supportsRtl="true" in their manifest, to allow Android to do RTL specific layout and drawing. This became the default for new projects created by Android Studio at some point.
React Native was not setting this in template, which means apps created from it do not do any of Android's RTL layout, text alignment, or drawing (e.g. in D3652980 8 years ago, a native drawer component came from the wrong side of the screen). RN would still layout the app using Yoga in RTL if in RTL locale though.
This change sets android:supportsRtl in template matching default new Android projects, and to avoid mismatched states in the future, will only tell I18NManager that RTL is allowed if android:supportsRtl is also set. This is breaking, since existing apps may not get Yoga RTL support unless telling Android that the application should support RTL layout.
Changelog:
[Android][Breaking] - Set and require android:supportsRtl="true" for RTL layout
Differential Revision: D57248205
This pull request was exported from Phabricator. Differential Revision: D57248205
| Platform | Engine | Arch | Size (bytes) | Diff |
|---|---|---|---|---|
| android | hermes | arm64-v8a | 19,558,630 | -6 |
| android | hermes | armeabi-v7a | n/a | -- |
| android | hermes | x86 | n/a | -- |
| android | hermes | x86_64 | n/a | -- |
| android | jsc | arm64-v8a | 22,928,778 | +16 |
| android | jsc | armeabi-v7a | n/a | -- |
| android | jsc | x86 | n/a | -- |
| android | jsc | x86_64 | n/a | -- |
Base commit: 3f17c8b5f04cd80517d7ba3943745f37dce7f5dd Branch: main
This pull request was exported from Phabricator. Differential Revision: D57248205
This pull request has been merged in facebook/react-native@82c6f8a58056cfa163a61a4e6668a54625b15d06.
This pull request was successfully merged by @NickGerleman in 82c6f8a58056cfa163a61a4e6668a54625b15d06.
When will my fix make it into a release? | How to file a pick request?