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

Add config component for layout animations #5045

Merged

Conversation

bartlomiejbloniarz
Copy link
Contributor

@bartlomiejbloniarz bartlomiejbloniarz commented Sep 5, 2023

Summary

This PR adds <LayoutAnimationConfig> - a wrapper component, which can be used to

  • disable entering animations on the first render of the wrapper
  • disable exiting animations when the wrapper is removed

It also adds a skipEnteringExitingAnimations prop to Animated.FlatList - when used entering and exiting animations of items will not start when the list appears/disappears.

Screen.Recording.2023-09-12.at.17.37.09.mov

Test plan

Check the behavior of FlatList skip entering & exiting and Nested LayoutAnimationConfig examples.

@bartlomiejbloniarz bartlomiejbloniarz marked this pull request as ready for review September 12, 2023 16:12
Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will post the rest of the review tomorrow.

app/src/examples/LayoutAnimations/FlatListSkipLayout.tsx Outdated Show resolved Hide resolved
app/src/examples/LayoutAnimations/NestedEntering.tsx Outdated Show resolved Hide resolved
src/reanimated2/component/LayoutAnimationConfig.tsx Outdated Show resolved Hide resolved
src/reanimated2/component/FlatList.tsx Show resolved Hide resolved
src/reanimated2/component/LayoutAnimationConfig.tsx Outdated Show resolved Hide resolved
Common/cpp/NativeModules/NativeReanimatedModule.cpp Outdated Show resolved Hide resolved
Common/cpp/LayoutAnimations/LayoutAnimationsManager.h Outdated Show resolved Hide resolved
Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp Outdated Show resolved Hide resolved
android/src/main/cpp/LayoutAnimations.cpp Outdated Show resolved Hide resolved
android/src/main/cpp/LayoutAnimations.cpp Outdated Show resolved Hide resolved
apple/LayoutReanimation/REAAnimationsManager.m Outdated Show resolved Hide resolved
apple/LayoutReanimation/REAAnimationsManager.m Outdated Show resolved Hide resolved
apple/native/NativeProxy.mm Outdated Show resolved Hide resolved
Common/cpp/NativeModules/NativeReanimatedModule.cpp Outdated Show resolved Hide resolved
Common/cpp/NativeModules/NativeReanimatedModule.cpp Outdated Show resolved Hide resolved
Common/cpp/NativeModules/NativeReanimatedModule.h Outdated Show resolved Hide resolved
Common/cpp/NativeModules/NativeReanimatedModuleSpec.h Outdated Show resolved Hide resolved
src/reanimated2/NativeReanimated/NativeReanimated.ts Outdated Show resolved Hide resolved
src/reanimated2/NativeReanimated/NativeReanimated.ts Outdated Show resolved Hide resolved
src/reanimated2/NativeReanimated/NativeReanimated.ts Outdated Show resolved Hide resolved
src/reanimated2/core.ts Outdated Show resolved Hide resolved
src/reanimated2/core.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@tjzel tjzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but let's wait for more people to approve this before merging.

Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

@bartlomiejbloniarz bartlomiejbloniarz added this pull request to the merge queue Sep 27, 2023
Merged via the queue into main with commit 5d2b374 Sep 27, 2023
@bartlomiejbloniarz bartlomiejbloniarz deleted the @bartlomiejbloniarz/add-layout-animation-config branch September 27, 2023 14:30
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.

3 participants