-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add additional config flag to allow forcing RTL on LTR locales #28129
Conversation
The Pull Request introduced fingerprint changes against the base commit: 9782fb3 Fingerprint diff[
{
"type": "dir",
"filePath": "../../packages/expo-localization/android",
"reasons": [
"expoAutolinkingAndroid"
],
"hash": "d4279285f5a3737985209267bde65337cf36189b"
}
] Generated by PR labeler π€ |
6304141
to
2b2c36e
Compare
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@@ -400,7 +400,7 @@ open class ExperienceActivity : BaseExperienceActivity(), StartReactInstanceDele | |||
) | |||
showOrReconfigureManagedAppSplashScreen(optimisticManifest) | |||
setLoadingProgressStatusIfEnabled() | |||
ExperienceRTLManager.setSupportsRTLFromManifest(this, optimisticManifest) | |||
ExperienceRTLManager.setRTLPreferencesFromManifest(this, optimisticManifest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be necessary to implement something similar in the dev client as it also configures the app based on the manifest. Not very important right now, but it would be nice to have that there too.
it.apply() | ||
} | ||
} else { | ||
if (supportsRTL == "true" || supportsRTL == "false") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (supportsRTL == "true" || supportsRTL == "false") { | |
if (supportsRTL != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, since we set those keys in the strings.xml
config template as unset
, we need this exact check.
.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE) | ||
.edit() | ||
.also { | ||
it.putBoolean(KEY_FOR_PREFS_ALLOWRTL, supportsRTL == "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also set KEY_FOR_PREFS_FORCERTL
to false
? This key may already exist in the shared preferences. We don't want to use the old value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do that but only if it's explicitly false
if (forcesRTL == "false") {
it.putBoolean(KEY_FOR_PREFS_FORCERTL, false)
}
Hi there! π I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) π
|
Why and how
There's this issue that has been going on for some time π
#26532
It's due to two things:
New key is:
Test Plan
Performed the following tests:
LTR/RTL depend on calling I18nManager.(force/allow)RTL β built in react-native behavior
if extra.forcesRTL true:
app RTL, I18nManager.isRTL true
if extra.supportsRTL true:
LTR/RTL depend on locale
app LTR, I18nManager.isRTL false
if extra.forcesRTL true:
app RTL, I18nManager.isRTL true
if extra.supportsRTL true:
LTR/RTL depend on locale
LTR/RTL depend on calling I18nManager.(force/allow)RTL β built in react-native behavior
if extra.forcesRTL true:
app RTL, I18nManager.isRTL true
if extra.supportsRTL true:
LTR/RTL depend on locale
app LTR, I18nManager.isRTL false
if extra.forcesRTL true:
app RTL, I18nManager.isRTL true
if extra.supportsRTL true:
LTR/RTL depend on locale
Checklist
npx expo prebuild
& EAS Build (eg: updated a module plugin).