Support Android Transitions during Fragment navigation #37857
Closed
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:
Adds support for Android Transitions during Fragment navigation.
React Native navigation libraries (like the Navigation router and React Native Screens) use Fragments to manage the stack of screens. But they can’t use Transitions to animate these Fragments because React Native images disappear during the Transition (see the videos in the Test Plan section below).
Navigation libraries are forced to setCustomAnimations instead of enter and exit Transitions. But animations have limitations compared to Transitions
Images disappearing during Transitions is a known Fresco bug. This PR applies the fix suggested by the Fresco repo.
Changelog:
[ANDROID] [FIXED] - Support Android Transitions during Fragment navigation
Test Plan:
I’ve created a minimal reproduction that demonstrates the bug. The first video below shows the example from that repo. You can see that the image disappears when changing the painting. It should fade out and in like the text does.
The second video shows the same example after the fix is applied. You can see that the painting fades out and in just like the text.
Screen.Recording.2023-06-12.at.22.41.07.mov
Screen.Recording.2023-06-12.at.22.39.48.mov