-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Migrate needsCustomLayoutForChildren check to the new architecture #34254
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
labels
Jul 23, 2022
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 |
javache
reviewed
Jul 25, 2022
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
approved these changes
Jul 26, 2022
@javache has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
javache
requested changes
Jul 27, 2022
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 👍 |
grahammendick
referenced
this pull request
in grahammendick/navigation
Jul 28, 2022
roryabraham
pushed a commit
to Expensify/react-native
that referenced
this pull request
Aug 17, 2022
…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
roryabraham
pushed a commit
to Expensify/react-native
that referenced
this pull request
Aug 17, 2022
…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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Merged
This PR has been merged.
Platform: Android
Android applications.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #34120
The new React Native architecture doesn't check
needsCustomLayoutForChildren
so 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
updateLayout
method of theSurfaceMountingManager
. TheSurfaceMountingManager
callsneedsCustomLayoutForChildren
on the parent view manager (copied the code from theNativeViewHierarchyManager
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 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