Skip to content
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

how to achieve slide from bottom transition in android #651

Closed
byteab opened this issue Sep 25, 2020 · 12 comments · Fixed by #848
Closed

how to achieve slide from bottom transition in android #651

byteab opened this issue Sep 25, 2020 · 12 comments · Fixed by #848

Comments

@byteab
Copy link

byteab commented Sep 25, 2020

is there any way to achieve slide from bottom transition. I have tried to change the screen to Modal or fullScreen modal. but it's the same transition animation at all cost.

@byteab byteab changed the title how to achieve slide from bottom transition how to achieve slide from bottom transition in android Sep 25, 2020
@Abhishek12345679
Copy link

Abhishek12345679 commented Sep 27, 2020

@EhsanSarshar
you can use this library.

React Native Swipe Gestures

It works most of the times.

@byteab
Copy link
Author

byteab commented Sep 28, 2020

@Abhishek12345679 I mean with this library. creating a slide animation is doable with gesture-handler and reanimated. but I mean why the 'modal' screen don't have a slide from bottom animation in android it's almost like the default transition

@hirbod
Copy link
Contributor

hirbod commented Sep 29, 2020

@EhsanSarshar there is an open PR introducing slide transitions for android.
#648

It's not merged yet but if they decide to add it, it should be an easy XML adjustment to support a slideUp transition (changing X to Y)

@WoLewicki
Copy link
Member

You can follow #662 since it implements this animation. You can also check this PR already and see if there are any problems with it @EhsanSarshar.

@WoLewicki
Copy link
Member

slide_from_bottom is one of the new transitions added with #848, you can add changes from it to your project in order to test it. Please comment here if something is wrong with it

@byteab
Copy link
Author

byteab commented Jul 12, 2021

@WoLewicki Thank you.
that's great. but still It's not like the default native slide from bottom transition in Android.

@WoLewicki
Copy link
Member

Can you tell which animation exactly do you want to achieve? I believe they depend on the Android version, #848 also added fade_from_bottom, which is Android Nougat default animation iirc.

@byteab
Copy link
Author

byteab commented Jul 12, 2021

when the foreground screen is moving up the background screen will also scale down a little bit. like when you slide the screen from right to left in ios the background screen will scale down a little bit

@WoLewicki
Copy link
Member

Is such transition available in transitionPresets of stack navigator of react-navigation? If so, could you tell which preset is it so we can update the transition resources?

@byteab
Copy link
Author

byteab commented Jul 13, 2021

Yeah it's available. but have some kind of weird transition issue. react-navigation/react-navigation#7775

@WoLewicki
Copy link
Member

react-navigation checks the version of your phone and applies transition based on this. We do not do such thing and you have to choose the transition you want by yourself. Can you show a video of the transition you would like to achieve for slide_from_bottom and maybe a xml with it if you are able to and describe precisely how it is different from slide_from_bottom of native-stack? It would really help us improve it.

@Maker-Mark
Copy link

With react navigation 6.x you can use animation: 'slide_from_bottom' which works well. I'm using this will a fullScreenModal stack screen.

  options={{
          presentation: 'fullScreenModal',
          animation: 'slide_from_bottom',
          headerShown: false,
        }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants