-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 duration of fading transition #6174
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merged
piaskowyk
reviewed
Jun 27, 2024
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/FadingTransition.ts
Outdated
Show resolved
Hide resolved
4 tasks
piaskowyk
requested changes
Jun 28, 2024
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/CurvedTransition.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/FadingTransition.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/JumpingTransition.ts
Outdated
Show resolved
Hide resolved
piaskowyk
requested changes
Jul 2, 2024
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/FadingTransition.ts
Outdated
Show resolved
Hide resolved
piaskowyk
requested changes
Jul 4, 2024
packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/FadingTransition.ts
Outdated
Show resolved
Hide resolved
piaskowyk
approved these changes
Jul 8, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jul 24, 2024
To be up to date we rewritten [Layout Transition](https://docs.swmansion.com/react-native-reanimated/docs/layout-animations/layout-transitions), implemented InteractiveExample with selectable transition and added new, refreshed videos. - [x] Jumping, Curved and Entry/Exit Transition are available on web - [x] This needs latest react-native-reanimated@nightly - [x] It includes new updated Fading default `duration` from this [PR](#6174). - [x] check default duration in transitions Before: https://github.com/software-mansion/react-native-reanimated/assets/59940332/9d845bcf-776c-4514-aa99-c825fb4ceef6 After: https://github.com/software-mansion/react-native-reanimated/assets/59940332/1e721176-273f-4740-b0a5-27f69f4a6140 How interactivExample works: https://github.com/software-mansion/react-native-reanimated/assets/59940332/cbe09f76-9579-4b13-9c4d-cbbd23911934
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Now the fading transition executes for
2*duration
miliseconds.We should divide the duration by 2 to fix it, the same way it done for the following transitions:
react-native-reanimated/packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/JumpingTransition.ts
Line 33 in 82d1d95
react-native-reanimated/packages/react-native-reanimated/src/layoutReanimation/defaultTransitions/SequencedTransition.ts
Line 44 in 82d1d95
Also I rename the variables that hold half of the duration and are named "duration" into "halfDuration", as it was suggested during the review
Test plan
Tests are in this PR: #6168