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

[Android] transitionDuration not supported #2666

Closed
freeboub opened this issue Feb 4, 2025 · 2 comments
Closed

[Android] transitionDuration not supported #2666

freeboub opened this issue Feb 4, 2025 · 2 comments
Labels
Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@freeboub
Copy link

freeboub commented Feb 4, 2025

Description

When using react-native-screens on android, the prop transitionDuration is not taken into account.
reproduced with fabric & react native 0.77.
It work fine on ios.

Sample video where I put 10sec in transitionDuration

Screen_recording_20250204_162033.webm

Steps to reproduce

Here is the sample code to reproduce the issue:

    <ScreenStack style={StyleSheet.absoluteFill}>
      <Screen
        key="parent"
        activityState={2}
        style={StyleSheet.absoluteFill}>
        <Pressable
            style={styles.pressable}
            onPress={() => {
              setChildDisplayed(true);
            }}/>
      </Screen>
      {childDisplayed ? (
        <Screen
          key="child"
          activityState={2}
          transitionDuration={10000}
          isNativeStack
          stackAnimation={'slide_from_bottom'}
          style={StyleSheet.absoluteFill}>
            <View style={styles.square}/>
        </Screen>) :
        <></> }
    </ScreenStack>

Snack or a link to a repository

https://github.com/freeboub/bug-react-native-screens-modal-animation

Screens version

4.6.0

React Native version

0.77.0

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided Platform: Android This issue is specific to Android labels Feb 4, 2025
@kkafar
Copy link
Member

kkafar commented Feb 4, 2025

Hey @freeboub, you're right it is not supported on Android. See the types:

/**
* Changes the duration (in milliseconds) of `slide_from_bottom`, `fade_from_bottom`, `fade` and `simple_push` transitions on iOS. Defaults to `500`.
* The duration of `default` and `flip` transitions isn't customizable.
*
* @platform ios
*/
transitionDuration?: number;

This is due to how animations are currently implemented on Android. Refactor of these is on my task board, however can't give any estimates.

I'll close the ticket, since it is not a bug.

@kkafar kkafar closed this as completed Feb 4, 2025
@freeboub
Copy link
Author

freeboub commented Feb 4, 2025

Ok, thank you for the quick feedback on this point !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

2 participants