Consider exposing Animated.Value with transition progress (for shared element transitions)
See original GitHub issueIt’d be great if the native stack navigator supported shared element transitions. One way of implementing that, without react-native-screens
needing to know anything about shared element transitions, is by exposing an Animated.Value
with the progress of the current transition running.
I explored a little how one might implement this.
In here, if you switched from [UIView animateWithDuration]
to UIViewPropertyAnimator
, you can get fractionComplete
:
This is an example of using UIViewPropertyAnimator with a custom view controller transition: https://stackoverflow.com/questions/27638806/transitioncoordinator-return-nil-for-custom-container-view-controller-in-ios8
From there, you would have a CADisplayLink
which sets the value for the animated node with the fractionComplete
from the UIViewPropertyAnimator
instance.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:32
- Comments:7 (4 by maintainers)
Top GitHub Comments
I added a first look at exposing progress of transition between screens on both platforms in https://github.com/software-mansion/react-native-screens/pull/890. I would be thankful if you could test it and share your thoughts.
@Jarred-Sumner Any updates on this? 👀
cc @kmagiera …