react-native-reanimated 2.3.0-alpha.3 → 2.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +15 -8
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +176 -154
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +49 -33
- package/Common/cpp/Registries/EventHandlerRegistry.cpp +14 -7
- package/Common/cpp/Registries/MapperRegistry.cpp +24 -20
- package/Common/cpp/Registries/WorkletsCache.cpp +19 -9
- package/Common/cpp/SharedItems/FrozenObject.cpp +17 -8
- package/Common/cpp/SharedItems/MutableValue.cpp +38 -25
- package/Common/cpp/SharedItems/MutableValueSetterProxy.cpp +11 -7
- package/Common/cpp/SharedItems/RemoteObject.cpp +9 -5
- package/Common/cpp/SharedItems/ShareableValue.cpp +211 -160
- package/Common/cpp/Tools/FeaturesConfig.cpp +5 -0
- package/Common/cpp/Tools/JSIStoreValueUser.cpp +25 -6
- package/Common/cpp/Tools/Mapper.cpp +30 -30
- package/Common/cpp/Tools/RuntimeDecorator.cpp +124 -86
- package/Common/cpp/Tools/Scheduler.cpp +6 -5
- package/Common/cpp/Tools/WorkletEventHandler.cpp +4 -2
- package/Common/cpp/headers/LayoutAnimations/LayoutAnimationsProxy.h +12 -11
- package/Common/cpp/headers/NativeModules/NativeReanimatedModule.h +50 -31
- package/Common/cpp/headers/NativeModules/NativeReanimatedModuleSpec.h +34 -16
- package/Common/cpp/headers/Registries/EventHandlerRegistry.h +15 -8
- package/Common/cpp/headers/Registries/MapperRegistry.h +5 -4
- package/Common/cpp/headers/Registries/WorkletsCache.h +9 -7
- package/Common/cpp/headers/SharedItems/FrozenObject.h +19 -11
- package/Common/cpp/headers/SharedItems/HostFunctionHandler.h +8 -4
- package/Common/cpp/headers/SharedItems/MutableValue.h +23 -12
- package/Common/cpp/headers/SharedItems/MutableValueSetterProxy.h +12 -7
- package/Common/cpp/headers/SharedItems/RemoteObject.h +19 -8
- package/Common/cpp/headers/SharedItems/RuntimeManager.h +26 -25
- package/Common/cpp/headers/SharedItems/ShareableValue.h +32 -27
- package/Common/cpp/headers/SharedItems/SharedParent.h +10 -7
- package/Common/cpp/headers/SharedItems/ValueWrapper.h +95 -72
- package/Common/cpp/headers/SpecTools/ErrorHandler.h +18 -19
- package/Common/cpp/headers/Tools/FeaturesConfig.h +19 -0
- package/Common/cpp/headers/Tools/JSIStoreValueUser.h +13 -16
- package/Common/cpp/headers/Tools/Mapper.h +19 -16
- package/Common/cpp/headers/Tools/PlatformDepMethodsHolder.h +17 -7
- package/Common/cpp/headers/Tools/ReanimatedHiddenHeaders.h +7 -11
- package/Common/cpp/headers/Tools/RuntimeDecorator.h +36 -27
- package/Common/cpp/headers/Tools/Scheduler.h +30 -35
- package/Common/cpp/headers/Tools/WorkletEventHandler.h +11 -8
- package/Common/cpp/hidden_headers/Logger.h +14 -14
- package/Common/cpp/hidden_headers/LoggerInterface.h +8 -9
- package/Common/cpp/hidden_headers/SpeedChecker.h +7 -8
- package/README.md +1 -1
- package/RNReanimated.podspec +24 -6
- package/android/build.gradle +38 -29
- package/android/react-native-reanimated-63-hermes.aar +0 -0
- package/android/react-native-reanimated-63-jsc.aar +0 -0
- package/android/react-native-reanimated-64-hermes.aar +0 -0
- package/android/react-native-reanimated-64-jsc.aar +0 -0
- package/android/react-native-reanimated-65-hermes.aar +0 -0
- package/android/react-native-reanimated-65-jsc.aar +0 -0
- package/android/react-native-reanimated-66-hermes.aar +0 -0
- package/android/react-native-reanimated-66-jsc.aar +0 -0
- package/android/react-native-reanimated-67-hermes.aar +0 -0
- package/android/react-native-reanimated-67-jsc.aar +0 -0
- package/ios/LayoutReanimation/REAAnimationsManager.h +10 -8
- package/ios/LayoutReanimation/REAAnimationsManager.m +91 -87
- package/ios/LayoutReanimation/REASnapshot.h +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +8 -7
- package/ios/LayoutReanimation/REAUIManager.h +4 -4
- package/ios/LayoutReanimation/REAUIManager.mm +116 -70
- package/ios/Nodes/REAAlwaysNode.m +14 -15
- package/ios/Nodes/REABezierNode.m +8 -7
- package/ios/Nodes/REABlockNode.m +1 -1
- package/ios/Nodes/REACallFuncNode.h +0 -1
- package/ios/Nodes/REACallFuncNode.m +10 -8
- package/ios/Nodes/REAClockNodes.m +22 -20
- package/ios/Nodes/REAConcatNode.h +0 -1
- package/ios/Nodes/REAConcatNode.m +2 -2
- package/ios/Nodes/REACondNode.m +7 -5
- package/ios/Nodes/READebugNode.m +5 -4
- package/ios/Nodes/REAEventNode.m +1 -1
- package/ios/Nodes/REAFunctionNode.h +0 -1
- package/ios/Nodes/REAFunctionNode.m +2 -2
- package/ios/Nodes/REAJSCallNode.m +4 -5
- package/ios/Nodes/REANode.h +3 -4
- package/ios/Nodes/REANode.m +9 -11
- package/ios/Nodes/REAOperatorNode.m +68 -67
- package/ios/Nodes/REAParamNode.h +1 -3
- package/ios/Nodes/REAParamNode.m +15 -17
- package/ios/Nodes/REAPropsNode.h +1 -3
- package/ios/Nodes/REAPropsNode.m +19 -22
- package/ios/Nodes/REASetNode.h +0 -1
- package/ios/Nodes/REASetNode.m +7 -5
- package/ios/Nodes/REAStyleNode.h +0 -1
- package/ios/Nodes/REAStyleNode.m +2 -4
- package/ios/Nodes/REATransformNode.h +0 -1
- package/ios/Nodes/REATransformNode.m +3 -5
- package/ios/Nodes/REAValueNode.m +5 -7
- package/ios/REAEventDispatcher.m +4 -4
- package/ios/REAModule.h +0 -2
- package/ios/REAModule.m +29 -38
- package/ios/REANodesManager.h +11 -19
- package/ios/REANodesManager.m +106 -130
- package/ios/REAUtils.h +5 -3
- package/ios/RNGestureHandlerStateManager.h +5 -0
- package/ios/Transitioning/RCTConvert+REATransition.m +45 -29
- package/ios/Transitioning/REAAllTransitions.h +2 -2
- package/ios/Transitioning/REAAllTransitions.m +14 -25
- package/ios/Transitioning/REATransition.h +8 -7
- package/ios/Transitioning/REATransition.m +19 -16
- package/ios/Transitioning/REATransitionAnimation.h +1 -1
- package/ios/Transitioning/REATransitionAnimation.m +2 -3
- package/ios/Transitioning/REATransitionManager.m +3 -3
- package/ios/native/NativeMethods.h +20 -5
- package/ios/native/NativeMethods.mm +14 -6
- package/ios/native/NativeProxy.h +4 -2
- package/ios/native/NativeProxy.mm +84 -63
- package/ios/native/REAIOSErrorHandler.h +13 -10
- package/ios/native/REAIOSErrorHandler.mm +19 -15
- package/ios/native/REAIOSLogger.h +8 -8
- package/ios/native/REAIOSLogger.mm +10 -6
- package/ios/native/REAIOSScheduler.h +5 -5
- package/ios/native/REAIOSScheduler.mm +17 -10
- package/ios/native/REAInitializer.h +5 -7
- package/ios/native/REAInitializer.mm +43 -31
- package/ios/native/UIResponder+Reanimated.mm +2 -2
- package/lib/Animated.js +9 -1
- package/lib/ConfigHelper.js +121 -138
- package/lib/ReanimatedEventEmitter.js +0 -1
- package/lib/ReanimatedModule.js +0 -1
- package/lib/ReanimatedModule.macos.js +0 -1
- package/lib/ReanimatedModule.native.js +5 -6
- package/lib/ReanimatedModule.windows.js +0 -1
- package/lib/ReanimatedModuleCompat.js +64 -35
- package/lib/createAnimatedComponent.js +468 -487
- package/lib/index.js +9 -1
- package/lib/reanimated2/NativeMethods.js +7 -12
- package/lib/reanimated2/NativeReanimated/NativeReanimated.js +37 -0
- package/lib/reanimated2/NativeReanimated/index.js +15 -0
- package/lib/reanimated2/PropAdapters.js +0 -1
- package/lib/reanimated2/UpdateProps.js +6 -7
- package/lib/reanimated2/ViewDescriptorsSet.js +4 -4
- package/lib/reanimated2/WorkletEventHandler.js +15 -13
- package/lib/reanimated2/animation/delay.js +8 -2
- package/lib/reanimated2/animation/spring.js +2 -0
- package/lib/reanimated2/animation/styleAnimation.js +7 -3
- package/lib/reanimated2/animation/util.js +25 -2
- package/lib/reanimated2/core.js +41 -17
- package/lib/reanimated2/globals.d.ts +21 -1
- package/lib/reanimated2/hook/useAnimatedRef.js +1 -1
- package/lib/reanimated2/hook/useAnimatedStyle.js +3 -3
- package/lib/reanimated2/index.js +1 -0
- package/lib/reanimated2/interpolation.js +95 -87
- package/lib/reanimated2/js-reanimated/JSReanimated.js +13 -10
- package/lib/reanimated2/js-reanimated/Mapper.js +4 -3
- package/lib/reanimated2/js-reanimated/MapperRegistry.js +3 -6
- package/lib/reanimated2/js-reanimated/MutableValue.js +0 -2
- package/lib/reanimated2/js-reanimated/index.js +10 -8
- package/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.js +33 -2
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +27 -124
- package/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +125 -0
- package/lib/reanimated2/layoutReanimation/animationBuilder/index.js +1 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +115 -45
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Default.js +7 -2
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.js +21 -21
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.js +25 -25
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +19 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +5 -5
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +17 -17
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.js +19 -19
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +9 -9
- package/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +33 -33
- package/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +78 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +128 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +37 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +41 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +34 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +46 -0
- package/lib/reanimated2/layoutReanimation/defaultTransitions/index.js +6 -0
- package/lib/reanimated2/layoutReanimation/index.js +1 -0
- package/lib/reanimated2/mock.js +3 -1
- package/lib/reanimated2/utils.js +9 -0
- package/lib/setAndForwardRef.js +14 -48
- package/libSo/fbjni/jni/arm64-v8a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/armeabi-v7a/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86/libfbjni.so +0 -0
- package/libSo/fbjni/jni/x86_64/libfbjni.so +0 -0
- package/mock.js +1 -1
- package/package.json +28 -17
- package/plugin.js +220 -39
- package/react-native-reanimated.d.ts +542 -547
- package/src/Animated.js +9 -1
- package/src/{ConfigHelper.js → ConfigHelper.ts} +15 -7
- package/src/{ReanimatedEventEmitter.js → ReanimatedEventEmitter.ts} +0 -0
- package/src/{ReanimatedModule.js → ReanimatedModule.macos.ts} +0 -0
- package/src/{ReanimatedModule.native.js → ReanimatedModule.native.ts} +0 -0
- package/src/{ReanimatedModule.macos.js → ReanimatedModule.ts} +0 -0
- package/src/{ReanimatedModule.windows.js → ReanimatedModule.windows.ts} +0 -0
- package/src/ReanimatedModuleCompat.ts +51 -0
- package/src/{createAnimatedComponent.js → createAnimatedComponent.tsx} +285 -126
- package/src/reanimated2/NativeMethods.ts +34 -13
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +72 -0
- package/src/reanimated2/NativeReanimated/index.ts +18 -0
- package/src/reanimated2/PropAdapters.ts +0 -1
- package/src/reanimated2/UpdateProps.ts +31 -15
- package/src/reanimated2/ViewDescriptorsSet.ts +15 -12
- package/src/reanimated2/WorkletEventHandler.ts +41 -23
- package/src/reanimated2/animation/commonTypes.ts +4 -4
- package/src/reanimated2/animation/decay.ts +2 -2
- package/src/reanimated2/animation/delay.ts +11 -5
- package/src/reanimated2/animation/index.ts +7 -7
- package/src/reanimated2/animation/repeat.ts +4 -4
- package/src/reanimated2/animation/sequence.ts +2 -2
- package/src/reanimated2/animation/spring.ts +6 -5
- package/src/reanimated2/animation/styleAnimation.ts +27 -15
- package/src/reanimated2/animation/timing.ts +5 -5
- package/src/reanimated2/animation/util.ts +47 -8
- package/src/reanimated2/commonTypes.ts +3 -0
- package/src/reanimated2/core.ts +80 -34
- package/src/reanimated2/globals.d.ts +21 -1
- package/src/reanimated2/hook/useAnimatedGestureHandler.ts +1 -1
- package/src/reanimated2/hook/useAnimatedRef.ts +13 -15
- package/src/reanimated2/hook/useAnimatedScrollHandler.ts +3 -3
- package/src/reanimated2/hook/useAnimatedStyle.ts +7 -7
- package/src/reanimated2/hook/utils.ts +4 -3
- package/src/reanimated2/index.ts +1 -0
- package/src/reanimated2/interpolation.ts +170 -103
- package/src/reanimated2/js-reanimated/JSReanimated.ts +37 -23
- package/src/reanimated2/js-reanimated/Mapper.ts +22 -9
- package/src/reanimated2/js-reanimated/MapperRegistry.ts +22 -19
- package/src/reanimated2/js-reanimated/MutableValue.ts +11 -11
- package/src/reanimated2/js-reanimated/index.ts +31 -14
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.ts +75 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.ts +29 -159
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +169 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +2 -2
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +3 -9
- package/src/reanimated2/layoutReanimation/animationBuilder/index.ts +1 -5
- package/src/reanimated2/layoutReanimation/defaultAnimations/Bounce.ts +162 -82
- package/src/reanimated2/layoutReanimation/defaultAnimations/Default.ts +7 -2
- package/src/reanimated2/layoutReanimation/defaultAnimations/Fade.ts +32 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Flip.ts +38 -38
- package/src/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.ts +34 -32
- package/src/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.ts +8 -8
- package/src/reanimated2/layoutReanimation/defaultAnimations/Roll.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Rotate.ts +26 -26
- package/src/reanimated2/layoutReanimation/defaultAnimations/Slide.ts +28 -28
- package/src/reanimated2/layoutReanimation/defaultAnimations/Stretch.ts +14 -14
- package/src/reanimated2/layoutReanimation/defaultAnimations/Zoom.ts +50 -50
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +104 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.ts +213 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.ts +60 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.ts +58 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.ts +41 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.ts +78 -0
- package/src/reanimated2/layoutReanimation/defaultTransitions/index.ts +6 -0
- package/src/reanimated2/layoutReanimation/index.ts +1 -0
- package/src/reanimated2/mock.ts +3 -1
- package/src/reanimated2/utils.ts +21 -0
- package/src/{setAndForwardRef.js → setAndForwardRef.ts} +12 -2
- package/android/react-native-reanimated-62-hermes.aar +0 -0
- package/android/react-native-reanimated-62-jsc.aar +0 -0
- package/lib/reanimated2/NativeReanimated.js +0 -48
- package/lib/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.js +0 -55
- package/lib/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.js +0 -165
- package/src/ReanimatedModuleCompat.js +0 -37
- package/src/reanimated2/NativeReanimated.ts +0 -70
- package/src/reanimated2/layoutReanimation/LayoutAnimationRepository.tsx +0 -41
- package/src/reanimated2/layoutReanimation/animationBuilder/BaseBounceAnimationBuilder.ts +0 -82
- package/src/reanimated2/layoutReanimation/animationBuilder/LayoutAnimationBuilder.ts +0 -217
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { withTiming, withSpring } from '../../animation';
|
|
2
|
+
import {
|
|
3
|
+
AnimationFunction,
|
|
4
|
+
BaseBuilderAnimationConfig,
|
|
5
|
+
LayoutAnimationAndConfig,
|
|
6
|
+
} from './commonTypes';
|
|
7
|
+
import { EasingFn } from '../../Easing';
|
|
8
|
+
import { BaseAnimationBuilder } from './BaseAnimationBuilder';
|
|
9
|
+
export class ComplexAnimationBuilder extends BaseAnimationBuilder {
|
|
10
|
+
easingV?: EasingFn;
|
|
11
|
+
rotateV?: string;
|
|
12
|
+
type?: AnimationFunction;
|
|
13
|
+
dampingV?: number;
|
|
14
|
+
massV?: number;
|
|
15
|
+
stiffnessV?: number;
|
|
16
|
+
overshootClampingV?: number;
|
|
17
|
+
restDisplacementThresholdV?: number;
|
|
18
|
+
restSpeedThresholdV?: number;
|
|
19
|
+
|
|
20
|
+
static createInstance: () => ComplexAnimationBuilder;
|
|
21
|
+
|
|
22
|
+
static easing(easingFunction: EasingFn): ComplexAnimationBuilder {
|
|
23
|
+
const instance = this.createInstance();
|
|
24
|
+
return instance.easing(easingFunction);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
easing(easingFunction: EasingFn): ComplexAnimationBuilder {
|
|
28
|
+
this.easingV = easingFunction;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static rotate(degree: string): ComplexAnimationBuilder {
|
|
33
|
+
const instance = this.createInstance();
|
|
34
|
+
return instance.rotate(degree);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rotate(degree: string): ComplexAnimationBuilder {
|
|
38
|
+
this.rotateV = degree;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static springify(): ComplexAnimationBuilder {
|
|
43
|
+
const instance = this.createInstance();
|
|
44
|
+
return instance.springify();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
springify(): ComplexAnimationBuilder {
|
|
48
|
+
this.type = withSpring as AnimationFunction;
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static damping(damping: number): ComplexAnimationBuilder {
|
|
53
|
+
const instance = this.createInstance();
|
|
54
|
+
return instance.damping(damping);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
damping(damping: number): ComplexAnimationBuilder {
|
|
58
|
+
this.dampingV = damping;
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static mass(mass: number): ComplexAnimationBuilder {
|
|
63
|
+
const instance = this.createInstance();
|
|
64
|
+
return instance.mass(mass);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
mass(mass: number): ComplexAnimationBuilder {
|
|
68
|
+
this.massV = mass;
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static stiffness(stiffness: number): ComplexAnimationBuilder {
|
|
73
|
+
const instance = this.createInstance();
|
|
74
|
+
return instance.stiffness(stiffness);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
stiffness(stiffness: number): ComplexAnimationBuilder {
|
|
78
|
+
this.stiffnessV = stiffness;
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static overshootClamping(overshootClamping: number): ComplexAnimationBuilder {
|
|
83
|
+
const instance = this.createInstance();
|
|
84
|
+
return instance.overshootClamping(overshootClamping);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
overshootClamping(overshootClamping: number): ComplexAnimationBuilder {
|
|
88
|
+
this.overshootClampingV = overshootClamping;
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static restDisplacementThreshold(
|
|
93
|
+
restDisplacementThreshold: number
|
|
94
|
+
): ComplexAnimationBuilder {
|
|
95
|
+
const instance = this.createInstance();
|
|
96
|
+
return instance.restDisplacementThreshold(restDisplacementThreshold);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
restDisplacementThreshold(
|
|
100
|
+
restDisplacementThreshold: number
|
|
101
|
+
): ComplexAnimationBuilder {
|
|
102
|
+
this.restDisplacementThresholdV = restDisplacementThreshold;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
static restSpeedThreshold(
|
|
107
|
+
restSpeedThreshold: number
|
|
108
|
+
): ComplexAnimationBuilder {
|
|
109
|
+
const instance = this.createInstance();
|
|
110
|
+
return instance.restSpeedThreshold(restSpeedThreshold);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
restSpeedThreshold(restSpeedThreshold: number): ComplexAnimationBuilder {
|
|
114
|
+
this.restSpeedThresholdV = restSpeedThreshold;
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
getAnimationAndConfig(): LayoutAnimationAndConfig {
|
|
119
|
+
const duration = this.durationV;
|
|
120
|
+
const easing = this.easingV;
|
|
121
|
+
const rotate = this.rotateV;
|
|
122
|
+
const type = this.type ? this.type : (withTiming as AnimationFunction);
|
|
123
|
+
const damping = this.dampingV;
|
|
124
|
+
const mass = this.massV;
|
|
125
|
+
const stiffness = this.stiffnessV;
|
|
126
|
+
const overshootClamping = this.overshootClampingV;
|
|
127
|
+
const restDisplacementThreshold = this.restDisplacementThresholdV;
|
|
128
|
+
const restSpeedThreshold = this.restSpeedThresholdV;
|
|
129
|
+
|
|
130
|
+
const animation = type;
|
|
131
|
+
|
|
132
|
+
const config: BaseBuilderAnimationConfig = {};
|
|
133
|
+
|
|
134
|
+
if (type === withTiming) {
|
|
135
|
+
if (easing) {
|
|
136
|
+
config.easing = easing;
|
|
137
|
+
}
|
|
138
|
+
if (duration) {
|
|
139
|
+
config.duration = duration;
|
|
140
|
+
}
|
|
141
|
+
if (rotate) {
|
|
142
|
+
config.rotate = rotate;
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
if (damping) {
|
|
146
|
+
config.damping = damping;
|
|
147
|
+
}
|
|
148
|
+
if (mass) {
|
|
149
|
+
config.mass = mass;
|
|
150
|
+
}
|
|
151
|
+
if (stiffness) {
|
|
152
|
+
config.stiffness = stiffness;
|
|
153
|
+
}
|
|
154
|
+
if (overshootClamping) {
|
|
155
|
+
config.overshootClamping = overshootClamping;
|
|
156
|
+
}
|
|
157
|
+
if (restDisplacementThreshold) {
|
|
158
|
+
config.restDisplacementThreshold = restDisplacementThreshold;
|
|
159
|
+
}
|
|
160
|
+
if (restSpeedThreshold) {
|
|
161
|
+
config.restSpeedThreshold = restSpeedThreshold;
|
|
162
|
+
}
|
|
163
|
+
if (rotate) {
|
|
164
|
+
config.rotate = rotate;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return [animation, config];
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Easing, EasingFn } from '../../Easing';
|
|
|
2
2
|
import { withDelay, withSequence, withTiming } from '../../animation';
|
|
3
3
|
import {
|
|
4
4
|
AnimationFunction,
|
|
5
|
-
|
|
5
|
+
EntryExitAnimationFunction,
|
|
6
6
|
IEntryExitAnimationBuilder,
|
|
7
7
|
KeyframeProps,
|
|
8
8
|
} from './commonTypes';
|
|
@@ -188,7 +188,7 @@ export class Keyframe implements IEntryExitAnimationBuilder {
|
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
build
|
|
191
|
+
build = (): EntryExitAnimationFunction => {
|
|
192
192
|
const delay = this.delayV;
|
|
193
193
|
const delayFunction = this.getDelayFunction();
|
|
194
194
|
const { keyframes, initialValues } = this.parseDefinitions();
|
|
@@ -27,8 +27,6 @@ export type EntryExitAnimationFunction = (
|
|
|
27
27
|
targetValues: EntryExitAnimationsValues
|
|
28
28
|
) => LayoutAnimation;
|
|
29
29
|
|
|
30
|
-
export type EntryExitAnimationBuild = () => EntryExitAnimationFunction;
|
|
31
|
-
|
|
32
30
|
export interface LayoutAnimationsValues {
|
|
33
31
|
originX: number;
|
|
34
32
|
originY: number;
|
|
@@ -42,14 +40,14 @@ export interface LayoutAnimationsValues {
|
|
|
42
40
|
bheight: number;
|
|
43
41
|
bglobalOriginX: number;
|
|
44
42
|
bglobalOriginY: number;
|
|
43
|
+
windowWidth: number;
|
|
44
|
+
windowHeight: number;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export type LayoutAnimationFunction = (
|
|
48
48
|
targetValues: LayoutAnimationsValues
|
|
49
49
|
) => LayoutAnimation;
|
|
50
50
|
|
|
51
|
-
export type LayoutAnimationBuild = () => LayoutAnimationFunction;
|
|
52
|
-
|
|
53
51
|
export interface ILayoutAnimationBuilder {
|
|
54
52
|
build: () => LayoutAnimationFunction;
|
|
55
53
|
}
|
|
@@ -75,10 +73,6 @@ export type LayoutAnimationAndConfig = [
|
|
|
75
73
|
BaseBuilderAnimationConfig
|
|
76
74
|
];
|
|
77
75
|
|
|
78
|
-
export interface BounceBuilderAnimationConfig {
|
|
79
|
-
duration?: number;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
76
|
export interface IEntryExitAnimationBuilder {
|
|
83
|
-
build:
|
|
77
|
+
build: () => EntryExitAnimationFunction;
|
|
84
78
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
export { BaseAnimationBuilder } from './BaseAnimationBuilder';
|
|
2
|
-
export {
|
|
3
|
-
export { LayoutAnimationBuilder, Layout } from './LayoutAnimationBuilder';
|
|
2
|
+
export { ComplexAnimationBuilder } from './ComplexAnimationBuilder';
|
|
4
3
|
export { Keyframe } from './Keyframe';
|
|
5
4
|
export {
|
|
6
5
|
LayoutAnimation,
|
|
7
6
|
AnimationFunction,
|
|
8
7
|
EntryExitAnimationsValues,
|
|
9
8
|
EntryExitAnimationFunction,
|
|
10
|
-
EntryExitAnimationBuild,
|
|
11
9
|
LayoutAnimationsValues,
|
|
12
10
|
LayoutAnimationFunction,
|
|
13
11
|
ILayoutAnimationBuilder,
|
|
14
12
|
BaseLayoutAnimationConfig,
|
|
15
13
|
BaseBuilderAnimationConfig,
|
|
16
14
|
LayoutAnimationAndConfig,
|
|
17
|
-
BounceBuilderAnimationConfig,
|
|
18
15
|
IEntryExitAnimationBuilder,
|
|
19
|
-
LayoutAnimationBuild,
|
|
20
16
|
} from './commonTypes';
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
import {
|
|
2
|
+
EntryExitAnimationFunction,
|
|
2
3
|
IEntryExitAnimationBuilder,
|
|
3
|
-
EntryExitAnimationBuild,
|
|
4
4
|
} from '../animationBuilder/commonTypes';
|
|
5
|
-
import { BaseBounceAnimationBuilder } from '../animationBuilder/BaseBounceAnimationBuilder';
|
|
6
5
|
import { withSequence, withTiming } from '../../animation';
|
|
7
6
|
import { Dimensions } from 'react-native';
|
|
7
|
+
import { BaseAnimationBuilder } from '../animationBuilder/BaseAnimationBuilder';
|
|
8
8
|
|
|
9
9
|
const { width, height } = Dimensions.get('window');
|
|
10
10
|
|
|
11
11
|
export class BounceIn
|
|
12
|
-
extends
|
|
12
|
+
extends BaseAnimationBuilder
|
|
13
13
|
implements IEntryExitAnimationBuilder {
|
|
14
14
|
static createInstance(): BounceIn {
|
|
15
15
|
return new BounceIn();
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
static getDuration(): number {
|
|
19
|
+
return 600;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
getDuration(): number {
|
|
23
|
+
return this.durationV ?? 600;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
build = (): EntryExitAnimationFunction => {
|
|
19
27
|
const delayFunction = this.getDelayFunction();
|
|
20
|
-
const delay = this.
|
|
21
|
-
const duration = this.
|
|
28
|
+
const delay = this.getDelay();
|
|
29
|
+
const duration = this.getDuration();
|
|
22
30
|
const callback = this.callbackV;
|
|
23
31
|
|
|
24
32
|
return () => {
|
|
@@ -30,10 +38,10 @@ export class BounceIn
|
|
|
30
38
|
scale: delayFunction(
|
|
31
39
|
delay,
|
|
32
40
|
withSequence(
|
|
33
|
-
withTiming(1.2, { duration: duration }),
|
|
34
|
-
withTiming(0.9, { duration:
|
|
35
|
-
withTiming(1.1, { duration:
|
|
36
|
-
withTiming(1, { duration:
|
|
41
|
+
withTiming(1.2, { duration: duration * 0.55 }),
|
|
42
|
+
withTiming(0.9, { duration: duration * 0.15 }),
|
|
43
|
+
withTiming(1.1, { duration: duration * 0.15 }),
|
|
44
|
+
withTiming(1, { duration: duration * 0.15 })
|
|
37
45
|
)
|
|
38
46
|
),
|
|
39
47
|
},
|
|
@@ -49,16 +57,24 @@ export class BounceIn
|
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
export class BounceInDown
|
|
52
|
-
extends
|
|
60
|
+
extends BaseAnimationBuilder
|
|
53
61
|
implements IEntryExitAnimationBuilder {
|
|
54
62
|
static createInstance(): BounceInDown {
|
|
55
63
|
return new BounceInDown();
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
|
|
66
|
+
static getDuration(): number {
|
|
67
|
+
return 600;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getDuration(): number {
|
|
71
|
+
return this.durationV ?? 600;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
build = (): EntryExitAnimationFunction => {
|
|
59
75
|
const delayFunction = this.getDelayFunction();
|
|
60
|
-
const delay = this.
|
|
61
|
-
const duration = this.
|
|
76
|
+
const delay = this.getDelay();
|
|
77
|
+
const duration = this.getDuration();
|
|
62
78
|
const callback = this.callbackV;
|
|
63
79
|
|
|
64
80
|
return () => {
|
|
@@ -70,10 +86,10 @@ export class BounceInDown
|
|
|
70
86
|
translateY: delayFunction(
|
|
71
87
|
delay,
|
|
72
88
|
withSequence(
|
|
73
|
-
withTiming(-20, { duration: duration }),
|
|
74
|
-
withTiming(10, { duration:
|
|
75
|
-
withTiming(-10, { duration:
|
|
76
|
-
withTiming(0, { duration:
|
|
89
|
+
withTiming(-20, { duration: duration * 0.55 }),
|
|
90
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
91
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
92
|
+
withTiming(0, { duration: duration * 0.15 })
|
|
77
93
|
)
|
|
78
94
|
),
|
|
79
95
|
},
|
|
@@ -93,16 +109,24 @@ export class BounceInDown
|
|
|
93
109
|
}
|
|
94
110
|
|
|
95
111
|
export class BounceInUp
|
|
96
|
-
extends
|
|
112
|
+
extends BaseAnimationBuilder
|
|
97
113
|
implements IEntryExitAnimationBuilder {
|
|
98
114
|
static createInstance(): BounceInUp {
|
|
99
115
|
return new BounceInUp();
|
|
100
116
|
}
|
|
101
117
|
|
|
102
|
-
|
|
118
|
+
static getDuration(): number {
|
|
119
|
+
return 600;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
getDuration(): number {
|
|
123
|
+
return this.durationV ?? 600;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
build = (): EntryExitAnimationFunction => {
|
|
103
127
|
const delayFunction = this.getDelayFunction();
|
|
104
|
-
const delay = this.
|
|
105
|
-
const duration = this.
|
|
128
|
+
const delay = this.getDelay();
|
|
129
|
+
const duration = this.getDuration();
|
|
106
130
|
const callback = this.callbackV;
|
|
107
131
|
|
|
108
132
|
return () => {
|
|
@@ -114,10 +138,10 @@ export class BounceInUp
|
|
|
114
138
|
translateY: delayFunction(
|
|
115
139
|
delay,
|
|
116
140
|
withSequence(
|
|
117
|
-
withTiming(20, { duration: duration }),
|
|
118
|
-
withTiming(-10, { duration:
|
|
119
|
-
withTiming(10, { duration:
|
|
120
|
-
withTiming(0, { duration:
|
|
141
|
+
withTiming(20, { duration: duration * 0.55 }),
|
|
142
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
143
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
144
|
+
withTiming(0, { duration: duration * 0.15 })
|
|
121
145
|
)
|
|
122
146
|
),
|
|
123
147
|
},
|
|
@@ -133,16 +157,24 @@ export class BounceInUp
|
|
|
133
157
|
}
|
|
134
158
|
|
|
135
159
|
export class BounceInLeft
|
|
136
|
-
extends
|
|
160
|
+
extends BaseAnimationBuilder
|
|
137
161
|
implements IEntryExitAnimationBuilder {
|
|
138
162
|
static createInstance(): BounceInLeft {
|
|
139
163
|
return new BounceInLeft();
|
|
140
164
|
}
|
|
141
165
|
|
|
142
|
-
|
|
166
|
+
static getDuration(): number {
|
|
167
|
+
return 600;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
getDuration(): number {
|
|
171
|
+
return this.durationV ?? 600;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
build = (): EntryExitAnimationFunction => {
|
|
143
175
|
const delayFunction = this.getDelayFunction();
|
|
144
|
-
const delay = this.
|
|
145
|
-
const duration = this.
|
|
176
|
+
const delay = this.getDelay();
|
|
177
|
+
const duration = this.getDuration();
|
|
146
178
|
const callback = this.callbackV;
|
|
147
179
|
|
|
148
180
|
return () => {
|
|
@@ -154,10 +186,10 @@ export class BounceInLeft
|
|
|
154
186
|
translateX: delayFunction(
|
|
155
187
|
delay,
|
|
156
188
|
withSequence(
|
|
157
|
-
withTiming(20, { duration: duration }),
|
|
158
|
-
withTiming(-10, { duration:
|
|
159
|
-
withTiming(10, { duration:
|
|
160
|
-
withTiming(0, { duration:
|
|
189
|
+
withTiming(20, { duration: duration * 0.55 }),
|
|
190
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
191
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
192
|
+
withTiming(0, { duration: duration * 0.15 })
|
|
161
193
|
)
|
|
162
194
|
),
|
|
163
195
|
},
|
|
@@ -173,16 +205,24 @@ export class BounceInLeft
|
|
|
173
205
|
}
|
|
174
206
|
|
|
175
207
|
export class BounceInRight
|
|
176
|
-
extends
|
|
208
|
+
extends BaseAnimationBuilder
|
|
177
209
|
implements IEntryExitAnimationBuilder {
|
|
178
210
|
static createInstance(): BounceInRight {
|
|
179
211
|
return new BounceInRight();
|
|
180
212
|
}
|
|
181
213
|
|
|
182
|
-
|
|
214
|
+
static getDuration(): number {
|
|
215
|
+
return 600;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
getDuration(): number {
|
|
219
|
+
return this.durationV ?? 600;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
build = (): EntryExitAnimationFunction => {
|
|
183
223
|
const delayFunction = this.getDelayFunction();
|
|
184
|
-
const delay = this.
|
|
185
|
-
const duration = this.
|
|
224
|
+
const delay = this.getDelay();
|
|
225
|
+
const duration = this.getDuration();
|
|
186
226
|
const callback = this.callbackV;
|
|
187
227
|
|
|
188
228
|
return () => {
|
|
@@ -194,10 +234,10 @@ export class BounceInRight
|
|
|
194
234
|
translateX: delayFunction(
|
|
195
235
|
delay,
|
|
196
236
|
withSequence(
|
|
197
|
-
withTiming(-20, { duration: duration }),
|
|
198
|
-
withTiming(10, { duration:
|
|
199
|
-
withTiming(-10, { duration:
|
|
200
|
-
withTiming(0, { duration:
|
|
237
|
+
withTiming(-20, { duration: duration * 0.55 }),
|
|
238
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
239
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
240
|
+
withTiming(0, { duration: duration * 0.15 })
|
|
201
241
|
)
|
|
202
242
|
),
|
|
203
243
|
},
|
|
@@ -213,16 +253,24 @@ export class BounceInRight
|
|
|
213
253
|
}
|
|
214
254
|
|
|
215
255
|
export class BounceOut
|
|
216
|
-
extends
|
|
256
|
+
extends BaseAnimationBuilder
|
|
217
257
|
implements IEntryExitAnimationBuilder {
|
|
218
258
|
static createInstance(): BounceOut {
|
|
219
259
|
return new BounceOut();
|
|
220
260
|
}
|
|
221
261
|
|
|
222
|
-
|
|
262
|
+
static getDuration(): number {
|
|
263
|
+
return 600;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
getDuration(): number {
|
|
267
|
+
return this.durationV ?? 600;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
build = (): EntryExitAnimationFunction => {
|
|
223
271
|
const delayFunction = this.getDelayFunction();
|
|
224
|
-
const delay = this.
|
|
225
|
-
const duration = this.
|
|
272
|
+
const delay = this.getDelay();
|
|
273
|
+
const duration = this.getDuration();
|
|
226
274
|
const callback = this.callbackV;
|
|
227
275
|
|
|
228
276
|
return () => {
|
|
@@ -234,10 +282,10 @@ export class BounceOut
|
|
|
234
282
|
scale: delayFunction(
|
|
235
283
|
delay,
|
|
236
284
|
withSequence(
|
|
237
|
-
withTiming(1.1, { duration:
|
|
238
|
-
withTiming(0.9, { duration:
|
|
239
|
-
withTiming(1.2, { duration:
|
|
240
|
-
withTiming(0, { duration: duration })
|
|
285
|
+
withTiming(1.1, { duration: duration * 0.15 }),
|
|
286
|
+
withTiming(0.9, { duration: duration * 0.15 }),
|
|
287
|
+
withTiming(1.2, { duration: duration * 0.15 }),
|
|
288
|
+
withTiming(0, { duration: duration * 0.55 })
|
|
241
289
|
)
|
|
242
290
|
),
|
|
243
291
|
},
|
|
@@ -253,16 +301,24 @@ export class BounceOut
|
|
|
253
301
|
}
|
|
254
302
|
|
|
255
303
|
export class BounceOutDown
|
|
256
|
-
extends
|
|
304
|
+
extends BaseAnimationBuilder
|
|
257
305
|
implements IEntryExitAnimationBuilder {
|
|
258
306
|
static createInstance(): BounceOutDown {
|
|
259
307
|
return new BounceOutDown();
|
|
260
308
|
}
|
|
261
309
|
|
|
262
|
-
|
|
310
|
+
static getDuration(): number {
|
|
311
|
+
return 600;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
getDuration(): number {
|
|
315
|
+
return this.durationV ?? 600;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
build = (): EntryExitAnimationFunction => {
|
|
263
319
|
const delayFunction = this.getDelayFunction();
|
|
264
|
-
const delay = this.
|
|
265
|
-
const duration = this.
|
|
320
|
+
const delay = this.getDelay();
|
|
321
|
+
const duration = this.getDuration();
|
|
266
322
|
const callback = this.callbackV;
|
|
267
323
|
|
|
268
324
|
return () => {
|
|
@@ -274,11 +330,11 @@ export class BounceOutDown
|
|
|
274
330
|
translateY: delayFunction(
|
|
275
331
|
delay,
|
|
276
332
|
withSequence(
|
|
277
|
-
withTiming(-10, { duration:
|
|
278
|
-
withTiming(10, { duration:
|
|
279
|
-
withTiming(-20, { duration:
|
|
333
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
334
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
335
|
+
withTiming(-20, { duration: duration * 0.15 }),
|
|
280
336
|
withTiming(height, {
|
|
281
|
-
duration: duration,
|
|
337
|
+
duration: duration * 0.55,
|
|
282
338
|
})
|
|
283
339
|
)
|
|
284
340
|
),
|
|
@@ -295,16 +351,24 @@ export class BounceOutDown
|
|
|
295
351
|
}
|
|
296
352
|
|
|
297
353
|
export class BounceOutUp
|
|
298
|
-
extends
|
|
354
|
+
extends BaseAnimationBuilder
|
|
299
355
|
implements IEntryExitAnimationBuilder {
|
|
300
356
|
static createInstance(): BounceOutUp {
|
|
301
357
|
return new BounceOutUp();
|
|
302
358
|
}
|
|
303
359
|
|
|
304
|
-
|
|
360
|
+
static getDuration(): number {
|
|
361
|
+
return 600;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
getDuration(): number {
|
|
365
|
+
return this.durationV ?? 600;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
build = (): EntryExitAnimationFunction => {
|
|
305
369
|
const delayFunction = this.getDelayFunction();
|
|
306
|
-
const delay = this.
|
|
307
|
-
const duration = this.
|
|
370
|
+
const delay = this.getDelay();
|
|
371
|
+
const duration = this.getDuration();
|
|
308
372
|
const callback = this.callbackV;
|
|
309
373
|
|
|
310
374
|
return () => {
|
|
@@ -316,11 +380,11 @@ export class BounceOutUp
|
|
|
316
380
|
translateY: delayFunction(
|
|
317
381
|
delay,
|
|
318
382
|
withSequence(
|
|
319
|
-
withTiming(10, { duration:
|
|
320
|
-
withTiming(-10, { duration:
|
|
321
|
-
withTiming(20, { duration:
|
|
383
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
384
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
385
|
+
withTiming(20, { duration: duration * 0.15 }),
|
|
322
386
|
withTiming(-height, {
|
|
323
|
-
duration: duration,
|
|
387
|
+
duration: duration * 0.55,
|
|
324
388
|
})
|
|
325
389
|
)
|
|
326
390
|
),
|
|
@@ -337,16 +401,24 @@ export class BounceOutUp
|
|
|
337
401
|
}
|
|
338
402
|
|
|
339
403
|
export class BounceOutLeft
|
|
340
|
-
extends
|
|
404
|
+
extends BaseAnimationBuilder
|
|
341
405
|
implements IEntryExitAnimationBuilder {
|
|
342
406
|
static createInstance(): BounceOutRight {
|
|
343
407
|
return new BounceOutLeft();
|
|
344
408
|
}
|
|
345
409
|
|
|
346
|
-
|
|
410
|
+
static getDuration(): number {
|
|
411
|
+
return 600;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
getDuration(): number {
|
|
415
|
+
return this.durationV ?? 600;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
build = (): EntryExitAnimationFunction => {
|
|
347
419
|
const delayFunction = this.getDelayFunction();
|
|
348
|
-
const delay = this.
|
|
349
|
-
const duration = this.
|
|
420
|
+
const delay = this.getDelay();
|
|
421
|
+
const duration = this.getDuration();
|
|
350
422
|
const callback = this.callbackV;
|
|
351
423
|
|
|
352
424
|
return () => {
|
|
@@ -358,11 +430,11 @@ export class BounceOutLeft
|
|
|
358
430
|
translateX: delayFunction(
|
|
359
431
|
delay,
|
|
360
432
|
withSequence(
|
|
361
|
-
withTiming(10, { duration:
|
|
362
|
-
withTiming(-10, { duration:
|
|
363
|
-
withTiming(20, { duration:
|
|
433
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
434
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
435
|
+
withTiming(20, { duration: duration * 0.15 }),
|
|
364
436
|
withTiming(-width, {
|
|
365
|
-
duration: duration,
|
|
437
|
+
duration: duration * 0.55,
|
|
366
438
|
})
|
|
367
439
|
)
|
|
368
440
|
),
|
|
@@ -379,16 +451,24 @@ export class BounceOutLeft
|
|
|
379
451
|
}
|
|
380
452
|
|
|
381
453
|
export class BounceOutRight
|
|
382
|
-
extends
|
|
454
|
+
extends BaseAnimationBuilder
|
|
383
455
|
implements IEntryExitAnimationBuilder {
|
|
384
456
|
static createInstance(): BounceOutRight {
|
|
385
457
|
return new BounceOutRight();
|
|
386
458
|
}
|
|
387
459
|
|
|
388
|
-
|
|
460
|
+
static getDuration(): number {
|
|
461
|
+
return 600;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
getDuration(): number {
|
|
465
|
+
return this.durationV ?? 600;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
build = (): EntryExitAnimationFunction => {
|
|
389
469
|
const delayFunction = this.getDelayFunction();
|
|
390
|
-
const delay = this.
|
|
391
|
-
const duration = this.
|
|
470
|
+
const delay = this.getDelay();
|
|
471
|
+
const duration = this.getDuration();
|
|
392
472
|
const callback = this.callbackV;
|
|
393
473
|
|
|
394
474
|
return () => {
|
|
@@ -400,11 +480,11 @@ export class BounceOutRight
|
|
|
400
480
|
translateX: delayFunction(
|
|
401
481
|
delay,
|
|
402
482
|
withSequence(
|
|
403
|
-
withTiming(-10, { duration:
|
|
404
|
-
withTiming(10, { duration:
|
|
405
|
-
withTiming(-20, { duration:
|
|
483
|
+
withTiming(-10, { duration: duration * 0.15 }),
|
|
484
|
+
withTiming(10, { duration: duration * 0.15 }),
|
|
485
|
+
withTiming(-20, { duration: duration * 0.15 }),
|
|
406
486
|
withTiming(width, {
|
|
407
|
-
duration: duration,
|
|
487
|
+
duration: duration * 0.55,
|
|
408
488
|
})
|
|
409
489
|
)
|
|
410
490
|
),
|