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

Animation duration between pages #1453

Closed
2 of 7 tasks
alabsi91 opened this issue May 21, 2022 · 14 comments
Closed
2 of 7 tasks

Animation duration between pages #1453

alabsi91 opened this issue May 21, 2022 · 14 comments
Labels
Missing info The user didn't precise the problem enough Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@alabsi91
Copy link

Description

  • After upgrading Expo from 44 to 45 the transition speed between the pages seems to be fixed.
  • Before upgrading Expo, the transition speed between pages follows the OS behavior.
  • I tuned off the animations completely on Android and the transition speed is still the same.

Expected behavior

  • The animation duration between pages to match the OS animation duration.

Actual behavior

  • The animation duration between pages does not change even if the OS animation duration is changed.

Reproduction

  • I recreated a new simple project for testing.
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import PagesList from './pagesList';
import Page from './page';

const Stack = createNativeStackNavigator();

const Page1 = () => <Page name='First Page' />;
const Page2 = () => <Page name='Second Page' />;
const Page3 = () => <Page name='Third Page' />;

export default function App() {
  return (
    <NavigationContainer>
      <Stack.Navigator initialRouteName='PageList'>
        <Stack.Screen name='PageList' component={PagesList} />
        <Stack.Screen name='Page1' component={Page1} />
        <Stack.Screen name='Page2' component={Page2} />
        <Stack.Screen name='Page3' component={Page3} />
      </Stack.Navigator>
    </NavigationContainer>
  );
}

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Workflow

  • Managed workflow
  • Bare workflow

Package versions

package version
react-native 0.68.2
@react-navigation/native 6.0.10
@react-navigation/native-stack 6.6.2
react-native-screens 3.11.1
react-native-safe-area-context 4.2.4
react-native-gesture-handler 2.2.1
react-native-reanimated 2.8.0
expo 45.0.0
@github-actions github-actions bot added Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided labels May 21, 2022
@github-actions
Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Steps To Reproduce section.

@github-actions github-actions bot added the Missing info The user didn't precise the problem enough label May 21, 2022
@jsp3536
Copy link

jsp3536 commented May 23, 2022

I have noticed the same thing after updating to Expo SDK 45. The page transitions are slower than they were in the previous versions on Android using the Pixel 6

@WoLewicki
Copy link
Member

WoLewicki commented May 27, 2022

I think it is the same problem as stated here: react-navigation/react-navigation#10591. Does the answer provided there solve your issue?

@alabsi91
Copy link
Author

I think it is the same problem as stated here: react-navigation/react-navigation#10591. Does the answer provided there solve your issue?

I changed the duration value in all files then runed expo start --clear. nothing changed the animation still the same.

@WoLewicki
Copy link
Member

Are you using managed workflow? If you use Expo managed workflow, the native code is included in the client and cannot be changed unfortunately.

@alabsi91
Copy link
Author

alabsi91 commented Jun 1, 2022

I couldn't find a solution so I switched to @react-navigation/stack .

@vladyslavNiemtsev
Copy link

I can confirm that it's also appears for me.

I'm not in Expo, just React Native

@vladyslavNiemtsev
Copy link

@WoLewicki I tried the solution that you mentioned in discussion above.

For me the problem was the screen scaling on transition, the default animation for android.
After I removed scaling - things comes smother but the only one issue is still here.

The slow navigation between screens.
I mean when I press PressableView with callback that run navigation.navigate - I have some delay before navigation.

@WoLewicki
Copy link
Member

@vladyslavNiemtsev can you reproduce it in all screens or just the ones with much content in them? Maybe the callback is dispatched after some time? I cannot think of any changes regarding the start of transition from the library's point of view.

@mohammad-goldast
Copy link

Same issue with React-Native 0.70.6 and React-Navigation 6.
Only on Android.

@mtushar53
Copy link

I am facing the same issue with React-Native 0.70.5 and React Navigation 6. I am using the Nested navigator of Drawer, Tab, and Stack navigation. When I remove the Drawer navigator and nested only Tab and Stack navigator, then the problem is not happening.

I think there has some issue with the Nested Drawer navigator. Waiting for the fixing.

@iraybi
Copy link

iraybi commented Nov 4, 2023

Anyone found the slow transition solution yet?

@alabsi91
Copy link
Author

alabsi91 commented Nov 4, 2023

It was fixed a while ago. Instead of following the OS animation duration, it is now fixed at 350ms, I think.

@hariskhalid366
Copy link

you should change the animation to ios and then set the duration to 150 it will work
<Stack.Navigator
screenOptions={{
statusBarStyle: colorScheme === 'dark' ? 'light' : 'dark',
navigationBarColor: Colors[colorScheme ?? 'light'].navBar,
statusBarColor: Colors[colorScheme ?? 'light'].statusBar,
animation: 'ios',
animationDuration: 150,
orientation: 'portrait',
}}>

</Stack.Navigator>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

No branches or pull requests

9 participants