-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Layout Animations for the New Architecture #6055
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
Merged
bartlomiejbloniarz
merged 85 commits into
main
from
@bartlomiejbloniarz/fabric-layout-animations
Jun 18, 2024
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
6ae1904
first attempt
bartlomiejbloniarz 96157bb
semi-working approach (issue with flickering)
bartlomiejbloniarz e0c0fcb
new approach (no flickering, but only ios works)
bartlomiejbloniarz 1b5ba60
No flicker (android is broken when nesting because of the threading m…
bartlomiejbloniarz 46bd2ab
Rewrite
bartlomiejbloniarz 3ace8a9
Add abstraction for exiting animations
bartlomiejbloniarz 649f7bf
Minor exiting fixes
bartlomiejbloniarz a0aee0a
Add logic for removal
bartlomiejbloniarz 9b5ac82
Fix indices
bartlomiejbloniarz 9e50bb1
Add window dimensions and better RNSStack handling
bartlomiejbloniarz 583ae94
Cleanup
bartlomiejbloniarz 43131f8
Cleanup 2
bartlomiejbloniarz a303ce0
Cleanup 3
bartlomiejbloniarz 97503e0
Cleanup 4
bartlomiejbloniarz 3ed1dd2
Stable iOS
bartlomiejbloniarz c2dd306
Fix flickering on android
bartlomiejbloniarz 95b954e
Stable android (but flickers came back :(()
bartlomiejbloniarz f1d734c
(hope)fully stable android with no flickers
bartlomiejbloniarz 210d8ac
Minor fixes + skip exiting
bartlomiejbloniarz 38432f6
Cleanup
bartlomiejbloniarz 824f1ec
Restore DefaultAnimations.tsx
bartlomiejbloniarz dbbf721
merg main
bartlomiejbloniarz 23c31e3
Fixes after merge
bartlomiejbloniarz e53959a
Change nativeId
bartlomiejbloniarz a9b22c9
Fix window dimensions for multiple surfaces
bartlomiejbloniarz 1e27e46
Mock global origin
bartlomiejbloniarz 508e344
Undo unnecessary changes
bartlomiejbloniarz 530116a
Rename + import sort function from RN
bartlomiejbloniarz b4c2f2a
Simplify layout metrics
bartlomiejbloniarz 917c2b5
Reorder + rename + simplify
bartlomiejbloniarz 8c89659
Restore original opacity in entering
bartlomiejbloniarz 4802fa7
Move layout animation objects initialization to helper functions
bartlomiejbloniarz 8584976
Trigger mount for the updated surface only
bartlomiejbloniarz 23e1e02
Handle cleanup mutations separately for surfaces
bartlomiejbloniarz 1871c77
Move to utils
bartlomiejbloniarz 8ec6add
Refactor MutationNode
bartlomiejbloniarz 6afb037
Cleanup
bartlomiejbloniarz a53a72a
Restore progressTransitionManager
bartlomiejbloniarz 1dfc738
Hide logging behind ifdef
bartlomiejbloniarz 40286c1
Handle stoi exception
bartlomiejbloniarz 4e7483e
Format
bartlomiejbloniarz 914e208
Cleanup logs
bartlomiejbloniarz 90b2a25
Simplify indices
bartlomiejbloniarz e9af8b1
Fix cleanup conflicting with exiting on indices
bartlomiejbloniarz 6462106
Change a bunch of booleans to a single state variable
bartlomiejbloniarz 9a290b1
merg
bartlomiejbloniarz f9b9600
Add workaround for nativeID to DefaultAnimationsExample
bartlomiejbloniarz 4434d4b
Fix timing issues with animation override
bartlomiejbloniarz 270001b
Cleanup
bartlomiejbloniarz 3cb83a7
Add clear config call
bartlomiejbloniarz 7af17fb
Fix android props update and reorders
bartlomiejbloniarz f9575a6
Cleanup
bartlomiejbloniarz b6b1ca9
Update Podfile.lock
bartlomiejbloniarz 6ef2d0f
Make LayoutAnimationsProxy a friend of NativeReanimatedModule
bartlomiejbloniarz c56d753
Remove fake friends :((
bartlomiejbloniarz 83b769e
Fix build issues
bartlomiejbloniarz a0ca2b2
Run formatting
bartlomiejbloniarz 2e46168
Fix linter issues
bartlomiejbloniarz 988bbef
Add a workaround for screen header
bartlomiejbloniarz 23c829c
forgor
bartlomiejbloniarz 914fa0d
merg
bartlomiejbloniarz ae11faf
refactor
bartlomiejbloniarz 9f66f96
Fix skipEntering
bartlomiejbloniarz 49a8462
Add comments
bartlomiejbloniarz 67e3824
Add view flattening handling
bartlomiejbloniarz 2d22cb4
merg monorepo
bartlomiejbloniarz 490ce6b
Avoid starting animations for non-layout updates
bartlomiejbloniarz 9e8e437
Remove IS_FABRIC const
bartlomiejbloniarz b60a5cd
Remove unnecessary SET init
bartlomiejbloniarz 97ba232
Move BBexample
bartlomiejbloniarz 00d4f99
Rename nativeID
bartlomiejbloniarz c958290
Separate LA init logic and entering configs
bartlomiejbloniarz 1ff01f9
Refactor utils
bartlomiejbloniarz 2030b22
Extract opacity fix
bartlomiejbloniarz becab04
Extract LayoutAnimation creation
bartlomiejbloniarz 2527050
Add threading comment
bartlomiejbloniarz acdffdc
Fix formatting
bartlomiejbloniarz 292e9e5
Add isMutationNode virtual function
bartlomiejbloniarz a0a1a04
Fix Gemfile.lock
bartlomiejbloniarz 0b5fd8a
Fix android
bartlomiejbloniarz 953c2d7
Change default animations example
bartlomiejbloniarz 5d3d03c
Add info to docs
bartlomiejbloniarz 9ff3572
Separate exiting config
bartlomiejbloniarz 64ffcf4
Add comment
bartlomiejbloniarz 6478644
Merge branch 'main' into @bartlomiejbloniarz/fabric-layout-animations
bartlomiejbloniarz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
apps/common-app/src/examples/LayoutAnimations/BBExample.tsx
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { Button, StyleSheet, View } from 'react-native'; | ||
| import Animated, { | ||
| BounceIn, | ||
| FadeInRight, | ||
| FadeInUp, | ||
| FadeOutLeft, | ||
| LinearTransition, | ||
| RotateOutDownLeft, | ||
| } from 'react-native-reanimated'; | ||
| import React, { useState } from 'react'; | ||
|
|
||
| export default function BBExample() { | ||
| const [show, setShow] = useState(true); | ||
| const [show2, setShow2] = useState(false); | ||
|
|
||
| return ( | ||
| <View style={styles.container}> | ||
| <Button title="toggle" onPress={() => setShow(!show)} /> | ||
| <Button title="toggle" onPress={() => setShow2(!show2)} /> | ||
| {show && ( | ||
| <Animated.View | ||
| onTouchStart={() => setShow(!show)} | ||
| entering={BounceIn} | ||
| layout={LinearTransition} | ||
| style={styles.box} | ||
| exiting={FadeOutLeft.duration(1000)}> | ||
| <Animated.View | ||
| style={styles.innerBox} | ||
| exiting={RotateOutDownLeft.duration(2000)} | ||
| entering={FadeInRight.delay(500)} | ||
| /> | ||
| </Animated.View> | ||
| )} | ||
| {show2 && ( | ||
| <Animated.View | ||
| entering={FadeInUp} | ||
| layout={LinearTransition.duration(2000)} | ||
| exiting={RotateOutDownLeft} | ||
| style={[styles.refresher, { width: show ? 200 : 100 }]} | ||
| /> | ||
| )} | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| alignItems: 'center', | ||
| marginTop: 200, | ||
| backgroundColor: 'pink', | ||
| }, | ||
| box: { | ||
| marginTop: 10, | ||
| width: 200, | ||
| height: 100, | ||
| backgroundColor: 'tomato', | ||
| }, | ||
| innerBox: { | ||
| marginTop: 10, | ||
| width: 100, | ||
| height: 50, | ||
| backgroundColor: 'green', | ||
| }, | ||
| refresher: { | ||
| marginTop: 10, | ||
| width: 100, | ||
| height: 100, | ||
| backgroundColor: 'blue', | ||
| }, | ||
| }); |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.