-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
StackNavigator: Allow configurable, different transition animations between screens #124
Comments
Sounds interesting. Haven't read it yet, but I think it'll be nicer to specify transition in navigationOptions = {
cardStack: {
transition: (fromRoute, toRoute) => {}
},
} |
@satya164 Thanks. I understand the intention to specify transition in ScreenA.navigationOptions = {
cardStack: {
transition: (fromRoute, toRoute) => TransitionA,
}
}
ScreenB.navigationOptions = {
cardStack: {
transition: (fromRoute, toRoute) => TransitionB,
}
} What transition we should use when moving from ScreenA to ScreenB? |
In the example you gave, if it's transitioning to B, then the I guess we can simplify it further, navigationOptions = {
cardStack: {
transition: (previousRoute: Route) => {
// configure the animation here
}
},
} So that it always configures the transition when you're transitioning to the route. In that case, it's not possible to introduce conflicts I think. |
when will this configuration be done? I am waiting for this implementation. |
Any update ? |
Check out #175 |
@lintonye thanks can you create PR ? |
It's still at the proof-of-concept stage -- far from complete. But feel free to keep track of #175 where I'll send updates from time to time. |
I'm not sure what the difference is between this and #175, so I'm gonna close this and let discussion continue there |
Motivation
Right now only one kind of animation is supported in a StackNavigator. It's useful to support different transitions between different screens in a same stack. For example, you may want shared elements transition between a photo grid and the photo's detail screen, and the default system transition when navigating to the settings screen.
Proposed API
Or, better yet, determine the transition dynamically:
Implementation Plan
With a minor change to
CardStack
, which exposestransitionProps
andprevTransitionProps
to thetransitionConfig
prop function, we can implement this for simple transitions such as opacity or translateX/Y animations. @ericvicenti also mentioned an approach to allow each screen to define what Card component to use. This should give more flexibility on how individual screens are animated during the transition.However, for more complex transitions that require information from multiple screens, such as the shared elements transition, we'd need some extra support. See #175.
The text was updated successfully, but these errors were encountered: