Commit Graph

4753 Commits

Author SHA1 Message Date
Joshua Gross 9c1926051e Pass blockNativeResponder param to setIsJSResponder
Summary:
The non-Fabric API has a `blockNativeResponder` param in setJSResponder. Make sure to pass that along in Fabric.

On Android this allows us to respect the flag and do the same thing non-Fabric was doing if `blockNativeResponder` is false. It's not clear yet what the impact is on iOS.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27058806

fbshipit-source-id: aa5074fa46191d78f5292a93d9040ab4bb58ca66
2021-03-15 18:37:36 -07:00
David Vacca e3e7701c14 Fix react-native-oss-android tests
Summary:
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: petetheheat

This diff removes the Nullable annotation added by  D27045861 (https://github.com/facebook/react-native/commit/903351f22ee8e0bced19257ddee7fdf8a7516278)
The goal is to fix react-native-oss-android tests

Changelog:
[Android][Changed] - Remove Nullable annotation from ActivityEventListener.onActivityResult method

Reviewed By: fkgozali

Differential Revision: D27063989

fbshipit-source-id: fda81c36380e4ffdf9d3bf3ca5ff47f8ebb415cc
2021-03-15 16:21:10 -07:00
Lulu Wu 903351f22e Fix media picking not working
Summary:
Media picking wasn't working for Venice because we didn't implement onActivityResult in BridgelessReactFragment so the listener in FBProfileGemstoneReactModule didn't called.

Changelog:
[Android][Changed] - Added Nullable annotation

Reviewed By: mdvacca

Differential Revision: D27045861

fbshipit-source-id: 0ab2961ef0570d92259856b4132507ebb264eb9d
2021-03-15 14:32:10 -07:00
Joshua Gross 7ac5d48341 Generalize "isVirtualView" logic to make debug asserts consistent with platform
Summary:
On Android we have the notion of "virtual views", which are defined consistently but the logic is scattered and duplicated throughout the codebase.

The logic exists to mark nodes that exist in the ShadowTree, but not the View tree. We want to CREATE, UPDATE, and DELETE them on the platform, but not INSERT or REMOVE
them. They basically exist as EventEmitter objects.

The only issue with this is (1) duplicated code, which opened the possibility for inconsistent definition (2) StubViewTree did not account for virtualized views, which caused
assert crashes in debug mode for certain LayoutAnimations on Android.

By moving the definition to ShadowViewMutation and accounting for it in StubViewTree, asserts are correct and consistent on all platforms.

This was not caught until recently, because, until recently, no asserts actually ran on Android.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27001199

fbshipit-source-id: eb29085317037ba8a286d7813bdd57095ad4746f
2021-03-15 13:50:56 -07:00
Lulu Wu 423453e105 Record latest error type in dev support
Summary:
In DevSupportManagerBase.java->updateLastErrorInfo(), errorType was not recorded like errorMessage and errorStack, we could either remove errorType as a parameter or recorded it for future use. This diff recorded it since it would make the error info complete.

Changelog:
[Android][Changed] - Record latest error type in dev support

Reviewed By: PeteTheHeat

Differential Revision: D26884647

fbshipit-source-id: 712d82667bdc4b3410f4c83a3df9a456af6d9061
2021-03-11 17:18:32 -08:00
Andrei Shikov 3ed133656f Use density from provided context for SurfaceHandler
Summary:
Changelog: [Internal]

We were using RN util to get pixel density, but it depends on the surface being created after venice instance is initialized. Given that we have context every time we update constraints, it makes sense to use it directly.

Reviewed By: mdvacca

Differential Revision: D26959430

fbshipit-source-id: 78701786efd82857812df689a725ba094fbd226e
2021-03-11 13:13:18 -08:00
Joshua Gross 6d1a4d3864 Add more debug logs to ReactHorizontalScrollView
Summary:
Just adding more logs I found useful while playing around with the last diff (to verify that these methods were not actually implicated at all).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26972725

fbshipit-source-id: 0e048e1edbfbe5ed32c5277f17a7197e0afdc04f
2021-03-11 10:57:47 -08:00
Joshua Gross b9b23e1ab1 Fix incorrect platform auto-scroll to right when height changes
Summary:
When the height of a HorizontalScrollView changes and there is a `layout` event, it can cause the underlying platform View code to scroll slightly to the right.

I'm... not really sure why, even after looking at the View code for a while. But it is clearly detectable and mirrors issues with RTL that were fixed recently.

This might warrant more investigation, but I believe the fix is relatively safe - we detect if there's an autoscroll only if the height changes and only if the scroll happens in "layout". That scopes the hack pretty well to just this bug.

There aren't really times when we actually want layout to scroll to the right, so... I think this is reasonable.

Changelog: [Changed][Android] Fixed issue that causes HorizontalScrollView to shift to the right when a TextInput is selected and keyboard pops up

Reviewed By: mdvacca

Differential Revision: D26972710

fbshipit-source-id: 441b1a3f07b9b68195a9e5e9a0c8d75c9d24a109
2021-03-11 10:57:47 -08:00
Joshua Gross 896baf79d5 Fix crash in ReactHorizontalScrollView debug logging
Summary:
Does not impact prod or even debug builds unless you switch on the debug flag. The issue is that we were trying to coerce booleans to integers.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D26970274

fbshipit-source-id: 3327029ae3afc307dd19b089c23c190cb9e3150c
2021-03-10 20:21:50 -08:00
Ramanpreet Nara 2b2c69aab1 Prevent TurboModuleManagerDelegate.mHybridData from being dead-code eliminated
Summary:
mHybridData should have a SuppressWarnings("unsed") annotation on it. Furthermore, we should add a DoNotStrip annotation, to make sure that the HybridData object doesn't get removed. We do the same in TurboModuleManager:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java?commit=5e1cd0c2ed84ff8e718473ff26145733868ebaba&lines=46-48

Changelog: [Internal]

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: fkgozali

Differential Revision: D26958686

fbshipit-source-id: 83c0626c0681966dfcda7f6e4fb4cbeac8340b3f
2021-03-10 15:10:51 -08:00
Ramanpreet Nara 23d9bf1a24 Make I18nManagerModule TurboModule-compatible
Summary:
This NativeModule will now be type-safe, and TurboModule-compatible.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D26956332

fbshipit-source-id: 6651a003c70819934869dd6a8c664ef984d0efcb
2021-03-10 14:55:29 -08:00
David Vacca fddac5908c Create MC to gate execution of JS Responder in Fabric Android
Summary:
Create MC to gate execution of JS Responder in Fabric Android

MC.react_fabric.enable_js_responder_fabric_android is enabled by default in the server

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26905296

fbshipit-source-id: 82504174394d1e10fd017435cccd38952404fda0
2021-03-08 21:58:34 -08:00
Joshua Gross 1163599989 Horizontal/ScrollView: rename reactScrollTo to scrollTo
Summary:
We can override the `scrollTo` method and it's likely/possible that Android internals are calling scrollTo directly. So, we can capture
more cases where the scroll position is changing and needs to be updated in Fabric State.

Unfortunately we still cannot override smoothScrollTo because it is marked as final. For now we just keep the custom `reactSmoothScrollTo` method
and hope that we can catch more cases with `scrollTo`.

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D26887028

fbshipit-source-id: e2678f1a20640d598abbec9671d6102635f65bb2
2021-03-08 15:30:51 -08:00
Joshua Gross de5e16f55c Back out "Try reduce flackiness of VeniceTest"
Summary:
Original commit changeset: 5af216e6bfa3

Changelog: [Internal]

Reviewed By: yungsters, mdvacca

Differential Revision: D26894424

fbshipit-source-id: 32cc4af2283ef9e80eaf57552c3dcfb3c1fa3c67
2021-03-08 15:09:04 -08:00
David Vacca 64f6f5e618 Cleanup TextAttributeProps class
Summary:
Quick cleanup of the TextAttributeProps class

There's no behavior changes expected

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26886807

fbshipit-source-id: b9ea9905a3767bd9540584adfb13bbd1ca976ea4
2021-03-08 13:08:39 -08:00
Andrei Shikov 8dc5ca6a6a Use SurfaceHandler in ReactSurface
Summary:
Changelog: [Internal]

Updates `ReactSurface` to use `SurfaceHandler` internally.
This removes most of the internal state in `ReactSurface` and propagates all the calls to the `SurfaceHandler`.

`FabricUIManager` now uses `SurfaceHandler` to start/stop the surface.
SurfaceId is still used for view operations. SurfaceId is also now mutable to play better with existing Android infra.

Reviewed By: shergin, mdvacca

Differential Revision: D26112992

fbshipit-source-id: 52e6860084d739381317035dc3011956d452063c
2021-03-08 12:20:41 -08:00
Joshua Gross b84ae3875c Immediately destroy C++ state when deleteView is processed
Summary:
Followup to D26858584 (https://github.com/facebook/react-native/commit/00959ffd6b9aebf52ca51ce7a747a375b5a8cdd1). We should also immediately destroy C++ state memory (which will decrement a shared_ptr) when deleting a view.

This could improve memory while a surface is being used.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D26876537

fbshipit-source-id: fc8353bed47db8fdbf5c7f6c6253ac788c460d9a
2021-03-07 13:19:50 -08:00
Ramanpreet Nara c94ef1e3b3 Introduce TurboModule.initialize()
Summary:
NativeModules have an initialize() method that they use to allocate any resources, set up listeners, etc. This diff imports that method into the TurboModule interface. This way, we don't have to cast TurboModules to NativeModules to initialize them. Also, it makes sense to import this initialization mechanism into the TurboModule infra.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D26871552

fbshipit-source-id: b8ae515b22928ed678b4003096e0756e991e10ff
2021-03-06 20:30:18 -08:00
Ramanpreet Nara 3f0df9788b Migrate all NativeModules to invalidate()
Summary:
This diff migrates all NativeModules away from onCatalystInstanceDestroy() to the invalidate() method.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D26871595

fbshipit-source-id: 132f6b75e485361835769a2b53bc742eefa47b59
2021-03-06 20:30:17 -08:00
Ramanpreet Nara 18c8417290 Deprecate NativeModule.onCatalystInstanceDestroy()
Summary:
## Rationale
The CatalystInstance is going away after we delete the bridge. So, we should migrate away from onCatalystInstanceDestroy() to something else: invalidate().

## Changes
- Introduce the NativeModule.invalidate() cleanup hook.
- Both the NativeModule and TurboModule infra now call this invalidate() method, **as opposed to** onCatalystInstanceDestroy(), to perform NativeModule cleanup.
- **Is this safe?** All our NativeModules extend BaseJavaModule. BaseJavaModule.invalidate() delegates to NativeModule.onCatalystInstanceDestroy(), so NativeModules that implement onCatalystInstanceDestroy(), but not invalidate(), still have their onCatalystInstanceDestroy() method called.

Changelog: [Android][Deprecated] - Deprecate NativeModule.onCatalystInstanceDestroy() for NativeModule.invalidate()

Reviewed By: JoshuaGross

Differential Revision: D26871001

fbshipit-source-id: e3bdfa0cf653ecbfe42791631bc6229af62f4817
2021-03-06 20:30:17 -08:00
Joshua Gross 8e2fa86c63 Add debug logging capabilities to ReactHorizontalScrollView
Summary:
When debugging this class a lot, I found it helpful to have these logs and it would have been nice if they were here already - I had to rewrite these several times.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26836318

fbshipit-source-id: 08eb9ae19923fc593d1aba031586a02a193d6b2d
2021-03-05 22:49:47 -08:00
Joshua Gross 365e12430a Fix content origin offset for RTL scripts
Summary:
changelog: [internal]

There were three separate problems preventing measure infra to work correctly with views inside horizontal scroll view in RTL environment.

1. Initial offset is wasn't communicated to Fabric. This is resolved separately as it doesn't affect only RTL: D26778991 (https://github.com/facebook/react-native/commit/630ac87591eb9d535bc32c6c42c624bfc3f1953f).
3. On Android when layout direction is RTL, offset of scrollview is calculated from right.

Reviewed By: mdvacca

Differential Revision: D26779860

fbshipit-source-id: 61572c78091a1f5417102eb38d88ba7d172e6102
2021-03-05 22:49:47 -08:00
Joshua Gross fc032cd8d8 Fix RTL content jumping
Summary:
Whenever layout updates in a horizontal scrollview, in RTL mode we adjust the position - the impact *should* be that initially, we jump from position 0 to the right side of the scroll view,
such that scrolling starts from the right.

However, we were doing this entirely too aggressively before. We should only make this adjustment *if the layout changes the width*.

Changelog: [Android][Changed] Fixed jumpy RTL horizontal ScrollViews. If you have Android-specific JS hacks for handling RTL in ScrollViews, you probably can/probably want to remove them, because they should be reliable now and require fewer hacks.

Reviewed By: mdvacca

Differential Revision: D26771366

fbshipit-source-id: de11bd1cae1414018d88ce44b3583a8b15f3b330
2021-03-05 22:49:47 -08:00
Joshua Gross 00959ffd6b Destroy Fabric State objects earlier in Java
Summary:
There are races between BackgroundExecutor and Fabric/View teardown, where, because of the way things are set up currently, a View will strongly retain a pointer into some native State object which can keep a host of other objects alive in C++, even after stopSurface, and even after RN itself starts tearing down.

To alleviate this, we more aggressively clear State from Java, without waiting for Java GC: 1) on stopSurface, 2) whenever a State object is stale from Java's perspective.

This should allow us to keep all common updateState semantics, while only introducing a new edge-case that stateWrapper can be destroyed during mounting if stopSurface happens at the same time. In those cases, checking for NPEs should be sufficient.

The possible race condition only really happens with updateState, so it's easier to check for. There should practically be no cases where there's a race between `stopSurface` and `getState`, because `getState` is only really called around state updates and view preallocation, and never after; we still check for NPEs in those cases, but it shouldn't be an issue.

Changelog: [Internal]

Reviewed By: thurn, sammy-SC, mdvacca

Differential Revision: D26858584

fbshipit-source-id: 2ef7467220865380037d69d8de322fe8797f6a12
2021-03-05 18:42:39 -08:00
Joshua Gross 47779de424 Make sure that FrescoModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859161

fbshipit-source-id: 654c055c53c0e420c6d9f2b0135055aec34269c9
2021-03-05 18:42:38 -08:00
Joshua Gross 4f38973b06 Make sure that DeviceInfoModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859157

fbshipit-source-id: 754a5b4ede8defa8b7742cc42e09cc7cbfe4e18d
2021-03-05 18:42:38 -08:00
Joshua Gross 77a23bdf0f Make sure that TimingModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859160

fbshipit-source-id: ce84deafd1f20d1680d333d1a176b0493623a4ee
2021-03-05 18:42:37 -08:00
Joshua Gross c2e44103b9 Make sure that AppStateModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859205

fbshipit-source-id: 5398d24d2592de3fbb80ca59192b5b46543aa5c5
2021-03-05 18:42:37 -08:00
Joshua Gross 66febd1e34 Make sure that AccessibilityInfoModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859159

fbshipit-source-id: 8e47cedd4b218a47b33d1209f3ede2fd1531015d
2021-03-05 18:42:37 -08:00
Joshua Gross 014c6f9636 Make sure that NativeAnimatedModule is subscribed to LifecycleEventListener events, and unsubscribes in onCatalystInstanceDestroy
Summary:
If modules are *not* eagerly init'd and expect lifecycle events, make sure (1) onHostResume is called immediately it it's currently active and (2) that listeners are removed in onCatalystInstanceDestroy.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26859158

fbshipit-source-id: 4966d3c49d194c4cb4063edf3a035f6077b76cd9
2021-03-05 18:42:36 -08:00
Joshua Gross aa305b34e3 Make sure that DialogModule is subscribed to LifecycleEventListener events
Summary:
I'm not sure what broke this, but in some cases, DialogModule doesn't get subscribed to LifecycleEventListener events.

This seems to fix it.

Changelog: [Internal]

Reviewed By: mdvacca, RSNara

Differential Revision: D26856016

fbshipit-source-id: 868baf102b85b202180adcbb8bb181dfe603188f
2021-03-05 18:42:36 -08:00
Samuel Susla a206f4fc2e Back out "Don't retain State in StateWrapperImpl"
Summary:
Changelog: [internal]

Original commit changeset: 0703c6dccc62

Reviewed By: yungsters

Differential Revision: D26849056

fbshipit-source-id: 2c6fca3ef06ac4868979d0a93c04c0eabdd56eb0
2021-03-05 10:45:25 -08:00
Lulu Wu 772fbf0a7d Fix venice test failure
Summary:
Changelog:
[Android][Changed] - Remove duplicate dependency

Reviewed By: mdvacca

Differential Revision: D26835371

fbshipit-source-id: 2a32b80bc0bb834f92473d003b940f8ffd3495fb
2021-03-05 05:16:49 -08:00
Lulu Wu 2b708560fc Fix ReactEditText crash
Summary:
Found this crash when rendering ReactEditText under Venice, from comment it's supposed to be called only in Paper, so I adde a Venice check to avoid calling this method.

{F446844248}

Changelog:
[Android][Changed] - Add a new check to avoid calling this method

Reviewed By: mdvacca

Differential Revision: D26781457

fbshipit-source-id: f4c2e890156a37e35aa153c736b50924254e67bc
2021-03-05 04:24:11 -08:00
Joshua Gross a65cd683ae Align View creation flow between Fabric and non-Fabric
Summary:
Ship responsibility for most View creation logic to ViewManager, where it already largely lies, and simplify code in Fabric and non-Fabric mounting layers.

Notably, some of this work was *already* being duplicated so we can expect an extremely tiny perf gain here.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26742711

fbshipit-source-id: 4213766d4cd366bc69cd47d4654f7b269bb9e7f4
2021-03-04 22:22:34 -08:00
Gaurav Gupta ea3495399b Android - pass initial props to ViewManager createView in non-Fabric (#31053)
Summary:
https://github.com/facebook/react-native/issues/31051
When trying to create custom viewmanagers,  we don't have props, I have a use case where I want to create views on the basis of provided react prop from react native.
## 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] [Changed] - pass initial props to ViewManager createViewInstance method in non-Fabric

Pull Request resolved: https://github.com/facebook/react-native/pull/31053

Test Plan:
Tested Manually.

(Facebook - see D26719538, which should land first)

Reviewed By: mdvacca

Differential Revision: D26719510

Pulled By: JoshuaGross

fbshipit-source-id: ced78aa919e6b433e22ddb7c9eccc3e3e91950e9
2021-03-04 22:22:34 -08:00
Samuel Susla e6931caca4 Don't retain State in StateWrapperImpl
Summary:
Changelog: [internal]

StateWrapperImpl shouldn't retain State strongly because cleanup of `StateWrapperImpl` is triggered from Java and isn't guaranteed to take happen before runtime is destroyed.

This should resolve crash where `StateWrapperImpl`'s destruction causes a `~Pointer` to be called after runtime is destroyed.

Chain of ownership that will be broken by storing State weakly inside `StateWrapperImpl`.
`StateWrapperImpl -> ParagraphState -> TextLayourManager's cache -> AttributedString -> ShadowView -> EventEmitter -> EventTarget -> Pointer`

{F451105831}

Reviewed By: JoshuaGross

Differential Revision: D26815275

fbshipit-source-id: 0703c6dccc62c1d152923b786a83273fa8a03694
2021-03-04 13:14:39 -08:00
Joshua Gross da8ed6b625 Disable setRemoveClippedSubviews in ReactHorizontalScrollContainerView.java in RTL mode
Summary:
setRemoveClippedSubviews in  ReactHorizontalScrollContainerView.java in RTL mode is overzealous and unexpectedly clips out views in a way that is not desirable.

It seems like what is actually happening is that the computed rect for the view is "0,0" and so contents are assumed to always be outside of this rect.

For now I've disabled this feature. We can investigate as a followup.

Changelog: [Android][Changed] Clipping subviews has been temporarily disabled in HorizontalScrollView in RTL mode. Minor/negligible perf impact.

Reviewed By: sammy-SC

Differential Revision: D26808937

fbshipit-source-id: 85af9c3fb542db9ca3aae03413a475695cd53391
2021-03-04 10:36:17 -08:00
David Vacca fca0442bc8 Extract ComponentNameRegistry out of Fabric modules
Summary:
This diff extracts ComponentNameRegistry out of Fabric modules

This is necessary to avoid depending on Fabric and regressing APK size for other RN apps (e.g. IG)

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26765328

fbshipit-source-id: 0a22c4279146f5243473c74a84e78fad7f08f956
2021-03-03 14:16:03 -08:00
David Vacca 056f1fd2cd Integrate ComponentNameResolver into ReactInstanceManager
Summary:
This diff integrates the ComponentNameResolver class into ReactInstanceManager

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26716900

fbshipit-source-id: e3a5f44485f659a32bf6094eee7985daf634f50f
2021-03-03 14:16:02 -08:00
David Vacca 2f5f6c40c2 Introduce ComponentNameResolverManager and ComponentNameResolver classes
Summary:
This diff introduces the ComponentNameResolverManager and ComponentNameResolver classes. The purpose of these classes is to integrate NativeComponentRegistryBinding into RN Android

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26716899

fbshipit-source-id: c62fb5c38ddce5325890d2506a6fb17d26043175
2021-03-03 14:16:02 -08:00
Samuel Susla 630ac87591 Report initial offset of horizontal scroll view to Fabric
Summary:
Changelog: [internal]

Calling `scrollTo` does not report offset change to Fabric core and measure infra can't compute correct values. This results in unresponsive buttons if horizontal scroll view on Android has initial offset set to anything besides default value 0.

Reviewed By: JoshuaGross

Differential Revision: D26778991

fbshipit-source-id: 5cad5cb9926c7923f6efcd56cb4e15c3b958c245
2021-03-03 13:05:22 -08:00
Héctor Ramos 6ccd0cdebb Bump Android compileSdkVersion and targetSdkVersion to 30 (#31078)
Summary:
## Summary

Bump Android compileSdkVersion and targetSdkVersion to 30

## Changelog

[Android][Changed] Bump Android compileSdkVersion and targetSdkVersion from 29 to 30

Pull Request resolved: https://github.com/facebook/react-native/pull/31078

Test Plan: Circle CI and Sandcastle

Reviewed By: mdvacca

Differential Revision: D26765188

Pulled By: hramos

fbshipit-source-id: a971641cea4860df58ce6e9b0f14405bfc4e0979
2021-03-02 16:40:48 -08:00
Lulu Wu be7f057bac Try reduce flackiness of VeniceTest
Summary:
Simplify addLifecycleEventListener for the flaky test because we just want to test that listener is working.

Changelog:
[Android][Changed] - Add a spare implementation of addLifecycleEventListener for test purpose.

Reviewed By: PeteTheHeat

Differential Revision: D26749256

fbshipit-source-id: 5af216e6bfa37a15eb189aa24a3df35a7a7112de
2021-03-02 16:32:44 -08:00
Andrei Shikov cbe7c445f7 Add logging to ReactModalHostView
Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D26752344

fbshipit-source-id: 0cc7987e553896144fadcc8ede8f37f74b4b5bc5
2021-03-02 13:52:32 -08:00
David Vacca caa5abc819 Remove unnecessary dependency from react buck module
Summary:
This diff removes an unnecessary dependency from react buck module

This was causing a regression in apk size in IG

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26755329

fbshipit-source-id: bc45d9717bb0343cd26ed2ccbaa016b55f56b9bf
2021-03-02 11:07:05 -08:00
Lulu Wu dec1b6ba15 Test setting layout params to wrap_content for fix text layout bug
Summary:
Changelog:
[Android][Fixed] -  Fix layout bug in ReactTextView.

Reviewed By: mdvacca

Differential Revision: D26752392

fbshipit-source-id: eeb9c16a4165b4d9329534981925621ae51a7dcb
2021-03-02 10:43:55 -08:00
Joshua Gross 5772c4947d Fix failing CircleCI test for touch event timestamp
Summary:
Timestamp is computed differently now and uses system millis as the basis for a monotonic clock. Updating this fixes tests.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D26739611

fbshipit-source-id: 4908da68e1c126ea2b0772aaf408d892798549aa
2021-03-01 18:13:02 -08:00
David Vacca 71ccc61802 Refactor ReactInstanceManager.getViewManagerNames
Summary:
This diff refactors the ReactInstanceManager.getViewManagerNames method to cache viewManager names

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26716898

fbshipit-source-id: 93985fe248e7b364081e04dd2b2c6d9b46cb8727
2021-03-01 17:55:16 -08:00
David Vacca 05f687fa88 Extract getViewportOffset out RootView
Summary:
This diff moves the method getViewportOffset out of ReactRootView. This is necessary to avoid Fabric to depend from paper.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26716901

fbshipit-source-id: cec67c24860a776fb361d7cda08d3142e1214c8c
2021-03-01 17:55:16 -08:00