-
Couldn't load subscription status.
- Fork 24.9k
Migrate needsCustomLayoutForChildren check to the new architecture #34254
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
Conversation
It's not working but it's a good first go. Tried to pass parent tag to the surface mounting manager - then implement call to needsCustomLayoutForChildren like in NativeViewHierarchyManager of old arch
Base commit: 0ce4ea2 |
The create mutation has the parent but the update doesn't so couldn't pass the parent tag to the surface manager on update
Base commit: 0ce4ea2 |
ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java
Outdated
Show resolved
Hide resolved
ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp
Outdated
Show resolved
Hide resolved
These are only guesses but seem sensible
|
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.java
Outdated
Show resolved
Hide resolved
As per review comment
|
This pull request was successfully merged by @grahammendick in e24ce70. When will my fix make it into a release? | Upcoming Releases |
|
@javache Thank you for your help and for merging it so quickly 👍 |
…acebook#34254) Summary: Fixes facebook#34120 The new React Native architecture doesn't check `needsCustomLayoutForChildren` so it wrongly positions native views on Android. In facebook#34120 there are videos comparing the positioning of a native action view in the old and the new architecture. This PR passes the parent tag to the `updateLayout` method of the `SurfaceMountingManager`. The `SurfaceMountingManager` calls `needsCustomLayoutForChildren` on the parent view manager (copied the code from the `NativeViewHierarchyManager` in the old architecture). **NOTE** - I wasn't sure where to get the parent shadow view from so I've put in my best guesses where I could and left it as `{}` otherwise. ## Changelog [Android] [Fixed] - Migrate `needsCustomLayoutForChildren` check to the new architecture Pull Request resolved: facebook#34254 Test Plan: I checked the fix in the repro from facebook#34165. Here is a video of the action view closing using the native button that is now visible in the new architecture. https://user-images.githubusercontent.com/1761227/180607896-35bf477f-4552-4b8a-8e09-9e8c49122c0c.mov Reviewed By: cipolleschi Differential Revision: D38153924 Pulled By: javache fbshipit-source-id: e2c77fa70d725a33ce73fe4a615f6d884312580c
…acebook#34254) Summary: Fixes facebook#34120 The new React Native architecture doesn't check `needsCustomLayoutForChildren` so it wrongly positions native views on Android. In facebook#34120 there are videos comparing the positioning of a native action view in the old and the new architecture. This PR passes the parent tag to the `updateLayout` method of the `SurfaceMountingManager`. The `SurfaceMountingManager` calls `needsCustomLayoutForChildren` on the parent view manager (copied the code from the `NativeViewHierarchyManager` in the old architecture). **NOTE** - I wasn't sure where to get the parent shadow view from so I've put in my best guesses where I could and left it as `{}` otherwise. ## Changelog [Android] [Fixed] - Migrate `needsCustomLayoutForChildren` check to the new architecture Pull Request resolved: facebook#34254 Test Plan: I checked the fix in the repro from facebook#34165. Here is a video of the action view closing using the native button that is now visible in the new architecture. https://user-images.githubusercontent.com/1761227/180607896-35bf477f-4552-4b8a-8e09-9e8c49122c0c.mov Reviewed By: cipolleschi Differential Revision: D38153924 Pulled By: javache fbshipit-source-id: e2c77fa70d725a33ce73fe4a615f6d884312580c
Summary
Fixes #34120
The new React Native architecture doesn't check
needsCustomLayoutForChildrenso it wrongly positions native views on Android. In #34120 there are videos comparing the positioning of a native action view in the old and the new architecture.This PR passes the parent tag to the
updateLayoutmethod of theSurfaceMountingManager. TheSurfaceMountingManagercallsneedsCustomLayoutForChildrenon the parent view manager (copied the code from theNativeViewHierarchyManagerin the old architecture).NOTE - I wasn't sure where to get the parent shadow view from so I've put in my best guesses where I could and left it as
{}otherwise.Changelog
[Android] [Fixed] - Migrate
needsCustomLayoutForChildrencheck to the new architectureTest Plan
I checked the fix in the repro from #34165. Here is a video of the action view closing using the native button that is now visible in the new architecture.
Screen.Recording.2022-07-23.at.14.39.10.mov