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

Fix respecting Reduced Motion Settings in Layout Animations on Fabric #6864

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

piaskowyk
Copy link
Member

@piaskowyk piaskowyk commented Jan 2, 2025

Summary

This PR addresses the issue of respecting reduced motion settings for Layout Animations on Fabric. In addition it avoids double initialisation of entering animation for Fabric.

Fixes #6863

With Disabled Reduced Motion

Screen.Recording.2025-01-02.at.17.05.23.mov

With Enabled Reduced Motion

before after
Screen.Recording.2025-01-02.at.17.02.40.mov
Screen.Recording.2025-01-02.at.17.01.42.mov

Test plan

Test Example code
import { Text, StyleSheet, View, Button } from 'react-native';
import Animated, { FadeIn, FadeOut, LinearTransition } from 'react-native-reanimated';

import React from 'react';

export default function EmptyExample() {
  const [toggle, setToggle] = React.useState(true);
  return (
    <View style={styles.container}>
      <Button title="Toggle" onPress={() => setToggle((prev) => !prev)} />
      {toggle && 
      <Animated.Text 
        entering={FadeIn.duration(2000)} 
        exiting={FadeOut.duration(1000)}
      >
        Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, Title 1, 
      </Animated.Text> }
      <Animated.Text 
        layout={LinearTransition.duration(1000)}
      >
        Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1, Paragraph 1
      </Animated.Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

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

Successfully merging this pull request may close these issues.

[iOS] Entering Animations not triggering when reduced motion is on
1 participant