-
-
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
Android - StackNavigator slide from right transition #705
Comments
Yea, I think right now they are not exported for you to use. Ideally, we should be able to define the transition for each screen so you do not enforce the whole app to have always the same. |
We can now pass in custom transition configurations to the stack navigator to enable any kind of animated transition we want on any platform! I considered possibly making a pull request to export the transition configs built into react-navigation, but considering we can write our own I am doubtful such a pull request would be accepted. So, I ported the slide from right transition config contained in react-navigation to this open source library that you can install and use to enable a slide from right transition on android. Check it out here: https://github.com/Traviskn/react-navigation-slide-from-right-transition |
It would really help if https://github.com/react-community/react-navigation/blob/d29dc05e739152cc58c89180947b95ecbadd3fd0/src/views/TransitionConfigs.js#L109 would pass in |
@mmerickel The slide transition I linked to on my repo does just that, it slides from the right when cards are pushed onto the stack, and slides from left when cards are popped off the stack. Granted, it would still definitely be very useful to change the transition config on the fly depending on which card you are on! |
@Traviskn I have four pages , A-B-C-D,now I want to goback to A from D directly, When I use react-navigation-slide-from-right-transition,they will flash in B page and C page, how can I fix it? Thank U! |
Exporting the |
we need to explain how to do this in docs, and if required, make changes to make it work in react-navigation. moving it to track in website: react-navigation/react-navigation.github.io#9 |
so what is the final solution on that ? currently i'm using react-navigation-slide-from-right-transition package, is there any intention to make this builtin react-navigation ? |
@alzalabany this is what I do: import CardStackStyleInterpolator from 'react-navigation/lib/views/CardStack/CardStackStyleInterpolator';
return StackNavigator(
{ /* Routes etc... */ },
{
transitionConfig: () => ({
screenInterpolator: sceneProps => {
return CardStackStyleInterpolator.forHorizontal(sceneProps);
}
}),
}
) |
@rogchap For me the module So this is the correct import (for me):
|
It seems that on Android the only animated transition available for the StackNavigator is 'fade in from bottom'. This is a reasonable default, but is it possible to configure a 'slide from right' transition on Android as is available on iOS?
The text was updated successfully, but these errors were encountered: