Summary:
This diff extends the current implementation of ScrollView.snapToAlignments from RN Android to reach feature parity with RNiOS
changelog: [Android][Changed] Implement ScrollView.snapToAlignments in RN Android
Reviewed By: javache
Differential Revision: D31206398
fbshipit-source-id: b6534965c476a0a4745ac98b419cbe05dc5c746e
Summary:
This diff implements the SnapToAlignment functionality in ReactScrollView for RN Android.
In order to use SnapToAlignment, the pagingEnabled prop should be set
Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)
I still need to verify how different RNiOS and RN Android behaviors are
changelog: [Android][Added] Implement SnapToAlignment in ReactScrollView
Reviewed By: JoshuaGross
Differential Revision: D31182786
fbshipit-source-id: a9b55d9c00326ae21ca9b89575e79c60bf9edcca
Summary:
This diff adds the new snapToAlignment into ReactScrollViewManager
changelog: [Android][Added] Implement snapToAlignment into ReactScrollViewManager
Reviewed By: JoshuaGross
Differential Revision: D31182787
fbshipit-source-id: 8049ceb462461a11f184dbc1b40ca8079a3e8b60
Summary:
This diff implements the SnapToAlignment functionality in ReactHorizontalScrollView for RN Android.
In order to use SnapToAlignment, the pagingEnabled prop should be set
Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)
I still need to verify how different RNiOS and RN Android behaviors are
changelog: [Android][Added] Implement SnapToAlignment in ReactHorizontalScrollView
Reviewed By: JoshuaGross
Differential Revision: D31174544
fbshipit-source-id: 204a82f55e3b7598124ce2528d8ad7d854c0ac77
Summary:
This diff adds the new snapToAlignment into ReactHorizontalScrollViewManager
changelog: [Android][Added] Implement snapToAlignment into ReactHorizontalScrollViewManager
Reviewed By: JoshuaGross
Differential Revision: D31174545
fbshipit-source-id: c56bfca207980428be98dd21a5387a0ff6bcd296
Summary:
This diff introduces a new interface named `SurfaceDelegate`. The interface abstracts the API for interacting with a surface, which is required for platforms other than mobile to implement how it wants to show and hide a surface. For existing Mobile use cases, the `LogBoxDialogSurfaceDelegate` is provided as a fallback solution so everything still works.
Changelog:
[Android][Added] - Add SurfaceDelegate abstraction to support interaction in multiple platforms and provide default implementation in LogBoxModule
Reviewed By: mdvacca
Differential Revision: D31132285
fbshipit-source-id: 13315a8bc5b7bcaee9b5e53ef5c6f6cc8cb01f31
Summary:
When TouchEvent is created in RN, we're currently using System.currentTimeMillis - but this can differ from the MotionEvent timestamp by a few milliseconds.
This difference is very minor but makes it challenging to implement touch telemetry. It's easy and should be zero-impact otherwise to align the timestamps.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D31183733
fbshipit-source-id: 5b275ee534658dc429beb1d3cec0c83a779b5ea3
Summary:
Uses `enableZ` trick to ensure that Skia doesn't try to reorder the views based on elevation. Unfortunately, it only helps for some cases, but the proper fix would require reimplementing `ViewGroup` completely to remove its internal logic of reordering based on Z coordinate.
Changelog: [Android][Fixed] Ensure elevated views are behind sticky header in FlatList
Reviewed By: cortinico
Differential Revision: D30700566
fbshipit-source-id: d2c59b22332922c610f4f2d415df34e81f5a33c5
Summary:
Changelog: [Internal]
Add a path calculation method to TouchTargetHelper to avoid relying on the view hierarchy ourselves and better support virtual touch targets.
Reviewed By: JoshuaGross
Differential Revision: D30993410
fbshipit-source-id: 17577c815413ab0f03bcb6a2140ea1d4c9fd694a
Summary:
to open possibilities for some DX enhancement, the pr introduces `DevSupportManagerFactory` customization. applications could implement a different DevSupportManager in ReactNativeHost.
## Changelog
[Internal] [Added] - Support custom DevSupportManager
Pull Request resolved: https://github.com/facebook/react-native/pull/31841
Test Plan: this pr just introduces some new interfaces and should not break existing functionalities.
Reviewed By: RSNara
Differential Revision: D30878134
Pulled By: yungsters
fbshipit-source-id: ccdf798caa322b07a876da8312b97002da057388
Summary:
Just a fix of a typo
changelog: [internal] internal
Reviewed By: javache
Differential Revision: D31076782
fbshipit-source-id: 192de92ba080a565acd67e038b370917ea9fcddc
Summary:
Try to reuse currentActivity when the new context from "mReactInstanceDevHelper.getCurrentActivity()" is null to fix "Unable to launch redbox because react activity is not available..."
Changelog:
[Android][Fixed] - Fix currentActivity being null when launching Redbox
Reviewed By: philIip
Differential Revision: D30942434
fbshipit-source-id: faf03390adc545376f3cec223eac5a16bf8233ea
Summary:
I'm cleaning up the extension to be just ReactExtension and not ReactAppExtension.
Similarly the name of the extension will be just `react` and not `reactApp`.
Changelog:
[Internal] [Changed] - Rename extension to just ReactExtension
Reviewed By: ShikaSD
Differential Revision: D30964793
fbshipit-source-id: 8a4207825d424e133e51495c34c21284c50363ae
Summary:
This Diff is merging over all the properties from `CodegenPluginExtension` to
`ReactAppExtension`. Some of the properties were duplicate and generally having two
extensions is creating a lot of confusion for the users (e.g. don't know where to place a
specific property).
Therefore I'm merging the two to have only one. I've also updated the property to use the
Gradle Lazy Configuration API.
Changelog:
[Android] [Changed] - Gradle: Merge CodegenPluginExtension inside ReactAppExtension
Reviewed By: ShikaSD
Differential Revision: D30961343
fbshipit-source-id: 66be3157efef356392c0701aaef2283d058d3161
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32177
This diff merges the `react-native-gradle-plugin` and the `react-codegen/android` into a single plugin.
This will allow us to iterate faster on a single plugin, will create less confusion for our users (`react` vs `reactApp`)
and will help us avoid race conditions when the two plugins are applied together (as we will control the whole lifecycle of it).
Changelog:
[Internal] [Changed] - Merged the two Gradle Plugins
allow-large-files
Reviewed By: ShikaSD
Differential Revision: D30765147
fbshipit-source-id: fcb02a181c7d900daa514107c637d0ee0225976c
Summary:
Addresses https://github.com/facebook/react-native/issues/28934
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Android] [Fixed] - When sending OS intents, always set "FLAG_ACTIVITY_NEW_TASK" flag (required by OS).
Pull Request resolved: https://github.com/facebook/react-native/pull/29000
Test Plan:
1. Open RNTester on Android
2. Go to Linking section
3. Try opening "POWER_USAGE_SUMMARY" intent
4. App should open settings, instead of crashing
Reviewed By: cortinico
Differential Revision: D30876645
Pulled By: lunaleaps
fbshipit-source-id: e427bfeadf9fb1ae38bf05bfeafd88e6776d71de
Summary:
This JavaScriptTimerManager interface calls into JavaScript to execute timers. For that reason, I think JavaScriptTimerExecutor is a better name for the interface.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D30851912
fbshipit-source-id: de282068d18693fd67331586e66847105ea16531
Summary:
I applied the changes requested in this PR: https://github.com/facebook/react-native/pull/29089
We upgraded to RN 0.62.2 on our latest release and started to see again the "Failed to load WebView provider: No WebView installed" (see below for Crashlytics screenshot)

This crash had been fixed by https://github.com/facebook/react-native/pull/24533 but https://github.com/facebook/react-native/pull/26189 (added in 0.62) reverted the fix
Indeed the exception raised in Crashlytics is actually a `AndroidRuntimeException` and `MissingWebViewPackageException` is only part of the message.
For instance, in the screenshot above, the exception message is `android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to load WebView provider: No WebView installed`
Now these crashes are quite tricky to reproduce, so to be on the safe side, I'm filtering out all exceptions containing `WebView` as suggested by thorbenprimke on the original fix.
If my reasoning is correct, it should fix siddhantsoni 's issue as well, since `WebView` is included in `MissingWebViewPackageException`
But following that reasoning, I am not sure https://github.com/facebook/react-native/pull/26189 fixed siddhantsoni 's issue, so siddhantsoni if you could check that this PR also fixes your issue, that would be great!
## Changelog
[Android] [Fixed] - Fix missing WebView provider crash in ForwardingCookieHandler
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/32165
Test Plan:
I created a version of react native with this patch applied
```
"react-native": "almouro/react-native#release/062-2-fix-missing-webview-provider"
```
Before the fix ~0.1% of our users were impacted on Android, no new crashes have occurred after the update.
This is putting back what was already in place and working for us, but making the check wider to catch more errors.
Reviewed By: lunaleaps
Differential Revision: D30847404
Pulled By: sota000
fbshipit-source-id: fe3b5fa2c9ebde5bedd17a9d6394a52ccdbdf0d0
Summary:
This change migrates fetching locale information from the deprecated Android locale api to the new locale api on sdk version 30+. The old api was deprecated some time ago and should not be used.
https://developer.android.com/reference/android/content/res/Configuration#locale
## Changelog
[Android] [Changed] - Use new Locale API on Android 11 (API 30)+
Pull Request resolved: https://github.com/facebook/react-native/pull/30701
Test Plan:
```js
if (Platform.OS === 'android') {
locale = NativeModules.I18nManager.localeIdentifier; // returns ex. 'EN_us'
}
```
Reviewed By: mdvacca
Differential Revision: D30821396
Pulled By: lunaleaps
fbshipit-source-id: 31622cd9c71c6057ff98ab5245898bc687b5ac60
Summary:
Changelog:
[Category][Internal]
This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after
[Hermes has changed its default max heap size to 3GiB](https://github.com/facebook/hermes/commit/5f2b47d0be6281fd2605d24efc0b43af42b4033d).
You can read about more context there.
Reviewed By: yungsters
Differential Revision: D30726067
fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e
Summary:
Right now, `react-native` on Android passes in an explicit Hermes config when initializes Hermes. The upcoming version of Hermes shipping with React Native 0.66 will handle this default config itself, so there's no need to override it from Android anymore.
Changelog:
[Android][Changed] - Hermes initialization will no longer need an explicit configuration.
Pull Request resolved: https://github.com/facebook/react-native/pull/31900
Test Plan: I compiled and ran a React Native app using the Android build, making sure to build `ReactAndroid` from source. I confirmed that the config was actually being applied by testing how much memory an application could eat before being killed.
Reviewed By: sshic
Differential Revision: D30675510
Pulled By: yungsters
fbshipit-source-id: 5eef056893b72ddd433ee808eb08d0eb56f22f72
Summary:
Changelog: [internal]
Remove RuntimeSchedulerManager on Android in favor of different way to initialise RuntimeScheduler.
Reviewed By: ShikaSD
Differential Revision: D30486975
fbshipit-source-id: 9fe38de12be452bd9d2c92bb54cf5933ce7555b5
Summary:
Displays views from the surface mounting manager after we hit a crash during mounting.
This change should help with debugging mounting crashes (e.g. when view is added before removal)
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D30681339
fbshipit-source-id: f83cecaf8e418a2fa5aa0713513c51bb1be77013
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32073
This Diff bumps the version of Gradle used to build the project to
7.0.2. Ideally we could bump to 7.2.x directly, but I'll do one minor version
at a time to exclude potential build problems.
This diff is addressing all the extra build warnings that got raised by the new version.
Changelog:
[Android][Changed] - Bumped Gradle project version to 7.0.2
Reviewed By: ShikaSD
Differential Revision: D30486612
fbshipit-source-id: 70e0f7d18e547013ca7b1d12f8dd64a633df5870
Summary:
When running native builds, we experience a lot of
bad file descriptor warnings. This diff is suppressing the issue on local builds (on Mac).
Changelog:
[Internal] [Changed] - Suppressed bad file descriptor on native builds
Reviewed By: ShikaSD
Differential Revision: D30487098
fbshipit-source-id: 8199fb8f2f18d19543d2861f1f2f852fff6ae73b
Summary:
Ship libjsi as a standalone dynamic library. This prevents problems
with exception handling caused by duplicate typeinfo across multiple
shared libs, and reduces bundle size by removing duplicate copies of
JSI.
Changelog: [Internal]
Reviewed By: fkgozali
Differential Revision: D30599215
fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96
Summary:
Implements the calculation of measurement and position of Text attachments in Android
Changelog: [Internal]
Reviewed By: JoshuaGross
Differential Revision: D30586616
fbshipit-source-id: e9ecc002f03477e3465d746855e1dff2e5f0b321
Summary:
hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int))
Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy
Changelog:
[Android][Changed] - Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text`
Reviewed By: JoshuaGross
Differential Revision: D30531096
fbshipit-source-id: 1a0b6e733bb21ce6b2f104a2025a79c16de3cfea