react-native-reanimated 2.5.0 → 2.8.0
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/SharedItems/ShareableValue.cpp +2 -2
- package/Common/cpp/Tools/RuntimeDecorator.cpp +0 -14
- package/RNReanimated.podspec +15 -6
- package/android/.gradle/7.2/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.2/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.2/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.2/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/build.gradle +13 -23
- 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/android/react-native-reanimated-68-hermes.aar +0 -0
- package/android/react-native-reanimated-68-jsc.aar +0 -0
- package/android/src/main/cpp/NativeProxy.cpp +22 -12
- package/android/src/main/cpp/headers/NativeProxy.h +2 -0
- package/android/src/main/java/com/swmansion/reanimated/NativeProxy.java +11 -8
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +13 -6
- package/ios/LayoutReanimation/REAAnimationsManager.h +1 -1
- package/ios/LayoutReanimation/REAAnimationsManager.m +2 -2
- package/ios/LayoutReanimation/REASnapshot.m +1 -1
- package/ios/LayoutReanimation/REAUIManager.h +1 -1
- package/ios/LayoutReanimation/REAUIManager.mm +4 -5
- package/ios/Nodes/REAAlwaysNode.h +1 -1
- package/ios/Nodes/REAAlwaysNode.m +5 -5
- package/ios/Nodes/REABezierNode.h +1 -1
- package/ios/Nodes/REABezierNode.m +4 -5
- package/ios/Nodes/REABlockNode.h +1 -1
- package/ios/Nodes/REABlockNode.m +2 -2
- package/ios/Nodes/REACallFuncNode.h +1 -1
- package/ios/Nodes/REACallFuncNode.m +5 -5
- package/ios/Nodes/REAClockNodes.h +1 -1
- package/ios/Nodes/REAClockNodes.m +4 -4
- package/ios/Nodes/REAConcatNode.h +1 -1
- package/ios/Nodes/REAConcatNode.m +3 -3
- package/ios/Nodes/REACondNode.h +1 -1
- package/ios/Nodes/REACondNode.m +3 -3
- package/ios/Nodes/READebugNode.h +1 -1
- package/ios/Nodes/READebugNode.m +3 -3
- package/ios/Nodes/REAEventNode.h +1 -2
- package/ios/Nodes/REAEventNode.m +3 -3
- package/ios/Nodes/REAFunctionNode.h +1 -1
- package/ios/Nodes/REAFunctionNode.m +3 -3
- package/ios/Nodes/REAJSCallNode.h +1 -1
- package/ios/Nodes/REAJSCallNode.m +3 -3
- package/ios/Nodes/REANode.m +2 -2
- package/ios/Nodes/REAOperatorNode.h +1 -1
- package/ios/Nodes/REAOperatorNode.m +2 -3
- package/ios/Nodes/REAParamNode.h +1 -1
- package/ios/Nodes/REAParamNode.m +4 -4
- package/ios/Nodes/REAPropsNode.h +1 -1
- package/ios/Nodes/REAPropsNode.m +4 -6
- package/ios/Nodes/REASetNode.h +1 -1
- package/ios/Nodes/REASetNode.m +4 -4
- package/ios/Nodes/REAStyleNode.h +1 -1
- package/ios/Nodes/REAStyleNode.m +2 -3
- package/ios/Nodes/REATransformNode.h +1 -1
- package/ios/Nodes/REATransformNode.m +2 -2
- package/ios/Nodes/REAValueNode.h +1 -3
- package/ios/Nodes/REAValueNode.m +1 -1
- package/ios/REAEventDispatcher.m +1 -1
- package/ios/REAModule.h +1 -1
- package/ios/REAModule.m +4 -5
- package/ios/REANodesManager.h +1 -2
- package/ios/REANodesManager.m +22 -24
- package/ios/Transitioning/RCTConvert+REATransition.h +1 -2
- package/ios/Transitioning/RCTConvert+REATransition.m +1 -1
- package/ios/Transitioning/REAAllTransitions.h +1 -1
- package/ios/Transitioning/REAAllTransitions.m +2 -3
- package/ios/Transitioning/REATransition.h +2 -3
- package/ios/Transitioning/REATransition.m +3 -4
- package/ios/Transitioning/REATransitionAnimation.m +1 -2
- package/ios/Transitioning/REATransitionManager.m +2 -4
- package/ios/Transitioning/REATransitionValues.m +2 -3
- package/ios/native/NativeMethods.h +1 -3
- package/ios/native/NativeMethods.mm +1 -1
- package/ios/native/NativeProxy.h +2 -2
- package/ios/native/NativeProxy.mm +20 -17
- package/ios/native/REAIOSErrorHandler.h +2 -4
- package/ios/native/REAIOSErrorHandler.mm +1 -1
- package/ios/native/REAIOSLogger.h +1 -3
- package/ios/native/REAIOSLogger.mm +1 -1
- package/ios/native/REAIOSScheduler.h +1 -3
- package/ios/native/REAIOSScheduler.mm +2 -2
- package/ios/native/REAInitializer.h +0 -7
- package/ios/native/REAInitializer.mm +2 -2
- package/ios/native/UIResponder+Reanimated.mm +3 -3
- package/ios/sensor/ReanimatedSensor.h +5 -1
- package/ios/sensor/ReanimatedSensor.m +49 -1
- package/ios/sensor/ReanimatedSensorContainer.h +1 -2
- package/ios/sensor/ReanimatedSensorContainer.m +2 -3
- package/lib/Animated.js +0 -9
- package/lib/ConfigHelper.js +0 -1
- package/lib/index.js +0 -9
- package/lib/reanimated2/Easing.js +9 -3
- package/lib/reanimated2/core.js +0 -36
- package/lib/reanimated2/globals.d.ts +1 -2
- package/lib/reanimated2/interpolateColor.js +11 -11
- package/lib/reanimated2/js-reanimated/index.js +3 -3
- package/lib/types/lib/ConfigHelper.d.ts +12 -0
- package/lib/types/lib/ReanimatedEventEmitter.d.ts +3 -0
- package/lib/types/lib/ReanimatedModule.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.macos.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.native.d.ts +2 -0
- package/lib/types/lib/ReanimatedModule.windows.d.ts +2 -0
- package/lib/types/lib/ReanimatedModuleCompat.d.ts +14 -0
- package/lib/types/lib/createAnimatedComponent.d.ts +33 -0
- package/lib/types/lib/reanimated2/Bezier.d.ts +6 -0
- package/lib/types/lib/reanimated2/Colors.d.ts +31 -0
- package/lib/types/lib/reanimated2/Easing.d.ts +172 -0
- package/lib/types/lib/reanimated2/NativeMethods.d.ts +14 -0
- package/lib/types/lib/reanimated2/NativeReanimated/NativeReanimated.d.ts +20 -0
- package/lib/types/lib/reanimated2/NativeReanimated/index.d.ts +3 -0
- package/lib/types/lib/reanimated2/PlatformChecker.d.ts +5 -0
- package/lib/types/lib/reanimated2/PropAdapters.d.ts +4 -0
- package/lib/types/lib/reanimated2/UpdateProps.d.ts +9 -0
- package/lib/types/lib/reanimated2/ViewDescriptorsSet.d.ts +20 -0
- package/lib/types/lib/reanimated2/WorkletEventHandler.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/MutableValue.d.ts +5 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.d.ts +13 -0
- package/lib/types/lib/reanimated2/__mocks__/NativeReanimated.native.d.ts +13 -0
- package/lib/types/lib/reanimated2/animation/commonTypes.d.ts +27 -0
- package/lib/types/lib/reanimated2/animation/decay.d.ts +19 -0
- package/lib/types/lib/reanimated2/animation/delay.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/animation/repeat.d.ts +12 -0
- package/lib/types/lib/reanimated2/animation/sequence.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/spring.d.ts +22 -0
- package/lib/types/lib/reanimated2/animation/styleAnimation.d.ts +7 -0
- package/lib/types/lib/reanimated2/animation/timing.d.ts +21 -0
- package/lib/types/lib/reanimated2/animation/util.d.ts +9 -0
- package/lib/types/lib/reanimated2/commonTypes.d.ts +79 -0
- package/lib/types/lib/reanimated2/component/FlatList.d.ts +9 -0
- package/lib/types/lib/reanimated2/component/WrappedComponents.d.ts +8 -0
- package/lib/types/lib/reanimated2/component/index.d.ts +9 -0
- package/lib/types/lib/reanimated2/core.d.ts +24 -0
- package/lib/types/lib/reanimated2/hook/Hooks.d.ts +5 -0
- package/lib/types/lib/reanimated2/hook/commonTypes.d.ts +14 -0
- package/lib/types/lib/reanimated2/hook/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedGestureHandler.d.ts +35 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedReaction.d.ts +12 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedRef.d.ts +3 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedScrollHandler.d.ts +21 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedSensor.d.ts +18 -0
- package/lib/types/lib/reanimated2/hook/useAnimatedStyle.d.ts +11 -0
- package/lib/types/lib/reanimated2/hook/useDerivedValue.d.ts +4 -0
- package/lib/types/lib/reanimated2/hook/useSharedValue.d.ts +2 -0
- package/lib/types/lib/reanimated2/hook/utils.d.ts +28 -0
- package/lib/types/lib/reanimated2/index.d.ts +12 -0
- package/lib/types/lib/reanimated2/interpolateColor.d.ts +26 -0
- package/lib/types/lib/reanimated2/interpolation.d.ts +14 -0
- package/lib/types/lib/reanimated2/jestUtils.d.ts +12 -0
- package/lib/types/lib/reanimated2/js-reanimated/JSReanimated.d.ts +30 -0
- package/lib/types/lib/reanimated2/js-reanimated/Mapper.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MapperRegistry.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/MutableValue.d.ts +14 -0
- package/lib/types/lib/reanimated2/js-reanimated/commonTypes.d.ts +44 -0
- package/lib/types/lib/reanimated2/js-reanimated/index.d.ts +15 -0
- package/lib/types/lib/reanimated2/layoutReanimation/LayoutAnimationRepository.d.ts +1 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.d.ts +22 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.d.ts +38 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/Keyframe.d.ts +25 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +77 -0
- package/lib/types/lib/reanimated2/layoutReanimation/animationBuilder/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Bounce.d.ts +62 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Default.d.ts +4 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Fade.d.ts +42 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Flip.d.ts +50 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Roll.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Rotate.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Slide.d.ts +34 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Stretch.d.ts +18 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/Zoom.d.ts +66 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultAnimations/index.d.ts +10 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.d.ts +19 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.d.ts +13 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.d.ts +7 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.d.ts +9 -0
- package/lib/types/lib/reanimated2/layoutReanimation/defaultTransitions/index.d.ts +6 -0
- package/lib/types/lib/reanimated2/layoutReanimation/index.d.ts +4 -0
- package/lib/types/lib/reanimated2/mock.d.ts +55 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.d.ts +1 -0
- package/lib/types/lib/reanimated2/platform-specific/RNRenderer.web.d.ts +0 -0
- package/lib/types/lib/reanimated2/utils.d.ts +7 -0
- package/lib/types/lib/setAndForwardRef.d.ts +40 -0
- package/lib/types/react-native-reanimated-tests.d.ts +1 -0
- package/package.json +7 -9
- package/plugin.js +26 -32
- package/react-native-reanimated.d.ts +39 -30
- package/src/Animated.js +0 -9
- package/src/ConfigHelper.ts +0 -1
- package/src/createAnimatedComponent.tsx +1 -1
- package/src/reanimated2/Easing.ts +9 -3
- package/src/reanimated2/commonTypes.ts +0 -1
- package/src/reanimated2/component/FlatList.tsx +1 -1
- package/src/reanimated2/core.ts +0 -47
- package/src/reanimated2/globals.d.ts +1 -2
- package/src/reanimated2/hook/useAnimatedSensor.ts +1 -3
- package/src/reanimated2/interpolateColor.ts +11 -11
- package/src/reanimated2/jestUtils.ts +11 -0
- package/src/reanimated2/js-reanimated/index.ts +3 -3
- package/android/expo/linking.gradle +0 -46
- package/android/expo/src/main/java/com/swmansion/reanimated/EXReanimatedAdapter.java +0 -12
- package/android/expo/src/main/java/expo/modules/adapters/reanimated/EXReanimatedPackage.java +0 -26
- package/expo-module.config.json +0 -3
|
@@ -64,7 +64,7 @@ void ShareableValue::adapt(
|
|
|
64
64
|
jsi::Object hiddenProperty = hiddenValue.asObject(rt);
|
|
65
65
|
if (hiddenProperty.isHostObject<FrozenObject>(rt)) {
|
|
66
66
|
type = ValueType::FrozenObjectType;
|
|
67
|
-
if (object.hasProperty(rt, "
|
|
67
|
+
if (object.hasProperty(rt, "__workletHash") && object.isFunction(rt)) {
|
|
68
68
|
type = ValueType::WorkletFunctionType;
|
|
69
69
|
}
|
|
70
70
|
valueContainer = std::make_unique<FrozenObjectWrapper>(
|
|
@@ -99,7 +99,7 @@ void ShareableValue::adapt(
|
|
|
99
99
|
} else if (value.isObject()) {
|
|
100
100
|
auto object = value.asObject(rt);
|
|
101
101
|
if (object.isFunction(rt)) {
|
|
102
|
-
if (object.getProperty(rt, "
|
|
102
|
+
if (object.getProperty(rt, "__workletHash").isUndefined()) {
|
|
103
103
|
// not a worklet, we treat this as a host function
|
|
104
104
|
type = ValueType::HostFunctionType;
|
|
105
105
|
containsHostFunction = true;
|
|
@@ -31,20 +31,6 @@ void RuntimeDecorator::decorateRuntime(
|
|
|
31
31
|
rt, "_LABEL", jsi::String::createFromAscii(rt, label));
|
|
32
32
|
|
|
33
33
|
jsi::Object dummyGlobal(rt);
|
|
34
|
-
auto dummyFunction = [](jsi::Runtime &rt,
|
|
35
|
-
const jsi::Value &thisValue,
|
|
36
|
-
const jsi::Value *args,
|
|
37
|
-
size_t count) -> jsi::Value {
|
|
38
|
-
return jsi::Value::undefined();
|
|
39
|
-
};
|
|
40
|
-
jsi::Function __reanimatedWorkletInit = jsi::Function::createFromHostFunction(
|
|
41
|
-
rt,
|
|
42
|
-
jsi::PropNameID::forAscii(rt, "__reanimatedWorkletInit"),
|
|
43
|
-
1,
|
|
44
|
-
dummyFunction);
|
|
45
|
-
|
|
46
|
-
dummyGlobal.setProperty(
|
|
47
|
-
rt, "__reanimatedWorkletInit", __reanimatedWorkletInit);
|
|
48
34
|
rt.global().setProperty(rt, "global", dummyGlobal);
|
|
49
35
|
|
|
50
36
|
rt.global().setProperty(rt, "jsThis", jsi::Value::undefined());
|
package/RNReanimated.podspec
CHANGED
|
@@ -3,27 +3,34 @@ require "json"
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
4
|
|
|
5
5
|
reactVersion = '0.0.0'
|
|
6
|
+
reactTargetTvOS = false
|
|
6
7
|
|
|
7
8
|
begin
|
|
8
9
|
# standard app
|
|
9
10
|
# /appName/node_modules/react-native-reanimated/RNReanimated.podspec
|
|
10
11
|
# /appName/node_modules/react-native/package.json
|
|
11
|
-
|
|
12
|
+
reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json")))
|
|
13
|
+
reactVersion = reactJson["version"]
|
|
14
|
+
reactTargetTvOS = reactJson["name"] == "react-native-tvos"
|
|
12
15
|
rescue
|
|
13
16
|
begin
|
|
14
17
|
# monorepo
|
|
15
18
|
# /monorepo/packages/appName/node_modules/react-native-reanimated/RNReanimated.podspec
|
|
16
19
|
# /monorepo/node_modules/react-native/package.json
|
|
17
|
-
|
|
20
|
+
reactJson = JSON.parse(File.read(File.join(__dir__, "..", "..", "..", "..", "node_modules", "react-native", "package.json")))
|
|
21
|
+
reactVersion = reactJson["version"]
|
|
22
|
+
reactTargetTvOS = reactJson["name"] == "react-native-tvos"
|
|
18
23
|
rescue
|
|
19
24
|
begin
|
|
20
25
|
# Example app in reanimated repo
|
|
21
26
|
# /react-native-reanimated/RNReanimated.podspec
|
|
22
27
|
# /react-native-reanimated/node_modules/react-native/package.json
|
|
23
|
-
|
|
28
|
+
reactJson = JSON.parse(File.read(File.join(__dir__, "node_modules", "react-native", "package.json")))
|
|
29
|
+
reactVersion = reactJson["version"]
|
|
30
|
+
reactTargetTvOS = ENV["ReanimatedTVOSExample"] == "1"
|
|
24
31
|
rescue
|
|
25
32
|
# should never happen
|
|
26
|
-
reactVersion = '0.
|
|
33
|
+
reactVersion = '0.68.0'
|
|
27
34
|
puts "[RNReanimated] Unable to recognized your `react-native` version! Default `react-native` version: " + reactVersion
|
|
28
35
|
end
|
|
29
36
|
end
|
|
@@ -78,7 +85,7 @@ Pod::Spec.new do |s|
|
|
|
78
85
|
|
|
79
86
|
s.requires_arc = true
|
|
80
87
|
|
|
81
|
-
s.dependency "React"
|
|
88
|
+
s.dependency "React-Core"
|
|
82
89
|
s.dependency 'FBLazyVector'
|
|
83
90
|
s.dependency 'FBReactNativeSpec'
|
|
84
91
|
s.dependency 'RCTRequired'
|
|
@@ -86,7 +93,9 @@ Pod::Spec.new do |s|
|
|
|
86
93
|
s.dependency 'React-Core'
|
|
87
94
|
s.dependency 'React-CoreModules'
|
|
88
95
|
s.dependency 'React-Core/DevSupport'
|
|
89
|
-
|
|
96
|
+
if !reactTargetTvOS
|
|
97
|
+
s.dependency 'React-RCTActionSheet'
|
|
98
|
+
end
|
|
90
99
|
s.dependency 'React-RCTNetwork'
|
|
91
100
|
s.dependency 'React-RCTAnimation'
|
|
92
101
|
s.dependency 'React-RCTLinking'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Thu Apr 21 15:44:53 UTC 2022
|
|
2
2
|
gradle.version=7.2
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -74,15 +74,6 @@ def resolveBuildType() {
|
|
|
74
74
|
return true
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
def resolveExpoLinkingGradle() {
|
|
78
|
-
def gradleScript = file("./expo/linking.gradle")
|
|
79
|
-
if (gradleScript.exists()) {
|
|
80
|
-
return "./expo/linking.gradle"
|
|
81
|
-
} else {
|
|
82
|
-
return "../android-npm/expo/linking.gradle"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
77
|
def isDeveloperMode() {
|
|
87
78
|
// developer mode, to run Example app
|
|
88
79
|
return file("$projectDir/../node_modules/react-native/package.json").exists()
|
|
@@ -291,9 +282,6 @@ if (!BUILD_FROM_SOURCE) {
|
|
|
291
282
|
// end if already loaded aar
|
|
292
283
|
if (!BUILD_FROM_SOURCE) return
|
|
293
284
|
|
|
294
|
-
// apply expo config
|
|
295
|
-
apply from: resolveExpoLinkingGradle()
|
|
296
|
-
|
|
297
285
|
def localProps = new Properties()
|
|
298
286
|
def localPropertiesFile = file("local.properties")
|
|
299
287
|
if (localPropertiesFile.exists()) {
|
|
@@ -701,17 +689,19 @@ task downloadNdkBuildDependencies {
|
|
|
701
689
|
task prepareThirdPartyNdkHeaders(dependsOn:[downloadNdkBuildDependencies, prepareBoost, prepareDoubleConversion, prepareFolly, prepareGlog]) {
|
|
702
690
|
}
|
|
703
691
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
task.name.contains("
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
692
|
+
def nativeBuildDependsOn(dependsOnTask) {
|
|
693
|
+
def buildTasks = tasks.findAll({ task ->
|
|
694
|
+
!task.name.contains("Clean") && (task.name.contains("externalNative") || task.name.contains("CMake")) })
|
|
695
|
+
buildTasks.forEach { task -> task.dependsOn(dependsOnTask) }
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
afterEvaluate {
|
|
699
|
+
extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders)
|
|
700
|
+
extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders)
|
|
701
|
+
|
|
702
|
+
nativeBuildDependsOn(prepareThirdPartyNdkHeaders)
|
|
703
|
+
nativeBuildDependsOn(extractAARHeaders)
|
|
704
|
+
nativeBuildDependsOn(extractSOFiles)
|
|
715
705
|
}
|
|
716
706
|
|
|
717
707
|
if (CLIENT_SIDE_BUILD) {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -37,6 +37,13 @@ NativeProxy::NativeProxy(
|
|
|
37
37
|
scheduler_(scheduler),
|
|
38
38
|
layoutAnimations(std::move(_layoutAnimations)) {}
|
|
39
39
|
|
|
40
|
+
NativeProxy::~NativeProxy() {
|
|
41
|
+
runtime_->global().setProperty(
|
|
42
|
+
*runtime_,
|
|
43
|
+
jsi::PropNameID::forAscii(*runtime_, "__reanimatedModuleProxy"),
|
|
44
|
+
jsi::Value::undefined());
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
jni::local_ref<NativeProxy::jhybriddata> NativeProxy::initHybrid(
|
|
41
48
|
jni::alias_ref<jhybridobject> jThis,
|
|
42
49
|
jlong jsContext,
|
|
@@ -192,18 +199,21 @@ void NativeProxy::installJSIBindings() {
|
|
|
192
199
|
platformDepMethodsHolder);
|
|
193
200
|
|
|
194
201
|
_nativeReanimatedModule = module;
|
|
195
|
-
|
|
196
|
-
this->registerEventHandler(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
std::weak_ptr<NativeReanimatedModule> weakModule = module;
|
|
203
|
+
this->registerEventHandler(
|
|
204
|
+
[weakModule, getCurrentTime](
|
|
205
|
+
std::string eventName, std::string eventAsString) {
|
|
206
|
+
if (auto module = weakModule.lock()) {
|
|
207
|
+
jsi::Object global = module->runtime->global();
|
|
208
|
+
jsi::String eventTimestampName =
|
|
209
|
+
jsi::String::createFromAscii(*module->runtime, "_eventTimestamp");
|
|
210
|
+
global.setProperty(
|
|
211
|
+
*module->runtime, eventTimestampName, getCurrentTime());
|
|
212
|
+
module->onEvent(eventName, eventAsString);
|
|
213
|
+
global.setProperty(
|
|
214
|
+
*module->runtime, eventTimestampName, jsi::Value::undefined());
|
|
215
|
+
}
|
|
216
|
+
});
|
|
207
217
|
|
|
208
218
|
runtime_->global().setProperty(
|
|
209
219
|
*runtime_,
|
|
@@ -131,6 +131,8 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
|
|
|
131
131
|
jni::alias_ref<LayoutAnimations::javaobject> layoutAnimations);
|
|
132
132
|
static void registerNatives();
|
|
133
133
|
|
|
134
|
+
~NativeProxy();
|
|
135
|
+
|
|
134
136
|
private:
|
|
135
137
|
friend HybridBase;
|
|
136
138
|
jni::global_ref<NativeProxy::javaobject> javaPart_;
|
|
@@ -147,14 +147,17 @@ public class NativeProxy {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
private void addDevMenuOption() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
150
|
+
// In Expo, `ApplicationContext` is not an instance of `ReactApplication`
|
|
151
|
+
if (mContext.get().getApplicationContext() instanceof ReactApplication) {
|
|
152
|
+
final DevSupportManager devSupportManager =
|
|
153
|
+
((ReactApplication) mContext.get().getApplicationContext())
|
|
154
|
+
.getReactNativeHost()
|
|
155
|
+
.getReactInstanceManager()
|
|
156
|
+
.getDevSupportManager();
|
|
157
|
+
|
|
158
|
+
devSupportManager.addCustomDevOption(
|
|
159
|
+
"Toggle slow animations (Reanimated)", this::toggleSlowAnimations);
|
|
160
|
+
}
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
@DoNotStrip
|
package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.swmansion.reanimated.layoutReanimation;
|
|
2
2
|
|
|
3
|
+
import android.app.Activity;
|
|
3
4
|
import android.util.DisplayMetrics;
|
|
4
5
|
import android.util.Log;
|
|
5
6
|
import android.view.View;
|
|
@@ -368,12 +369,18 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
368
369
|
preparedValues.put(key, PixelUtil.toDIPFromPixel((int) values.get(key)));
|
|
369
370
|
}
|
|
370
371
|
|
|
371
|
-
DisplayMetrics
|
|
372
|
-
mContext.getCurrentActivity()
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
372
|
+
DisplayMetrics displayMetrics = new DisplayMetrics();
|
|
373
|
+
Activity currentActivity = mContext.getCurrentActivity();
|
|
374
|
+
if (currentActivity != null) {
|
|
375
|
+
currentActivity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
|
376
|
+
int height = displayMetrics.heightPixels;
|
|
377
|
+
int width = displayMetrics.widthPixels;
|
|
378
|
+
preparedValues.put("windowWidth", PixelUtil.toDIPFromPixel(width));
|
|
379
|
+
preparedValues.put("windowHeight", PixelUtil.toDIPFromPixel(height));
|
|
380
|
+
} else {
|
|
381
|
+
preparedValues.put("windowWidth", PixelUtil.toDIPFromPixel(0));
|
|
382
|
+
preparedValues.put("windowHeight", PixelUtil.toDIPFromPixel(0));
|
|
383
|
+
}
|
|
377
384
|
return preparedValues;
|
|
378
385
|
}
|
|
379
386
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAAnimationsManager.h>
|
|
2
|
+
#import <RNReanimated/REAUIManager.h>
|
|
2
3
|
#import <React/RCTComponentData.h>
|
|
3
4
|
#import <React/RCTTextView.h>
|
|
4
5
|
#import <React/UIView+Private.h>
|
|
5
6
|
#import <React/UIView+React.h>
|
|
6
|
-
#import "REAUIManager.h"
|
|
7
7
|
|
|
8
8
|
@interface REAAnimationsManager ()
|
|
9
9
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
#import "REAUIManager.h"
|
|
2
1
|
#import <Foundation/Foundation.h>
|
|
3
|
-
#
|
|
4
|
-
#import
|
|
5
|
-
#
|
|
6
|
-
|
|
2
|
+
#import <RNReanimated/FeaturesConfig.h>
|
|
3
|
+
#import <RNReanimated/REAIOSScheduler.h>
|
|
4
|
+
#import <RNReanimated/REAUIManager.h>
|
|
5
|
+
#import <RNReanimated/Scheduler.h>
|
|
7
6
|
#import <React/RCTComponentData.h>
|
|
8
7
|
#import <React/RCTLayoutAnimation.h>
|
|
9
8
|
#import <React/RCTLayoutAnimationGroup.h>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAAlwaysNode.h>
|
|
2
|
+
#import <RNReanimated/REAModule.h>
|
|
3
|
+
#import <RNReanimated/REANodesManager.h>
|
|
4
|
+
#import <RNReanimated/REAStyleNode.h>
|
|
5
|
+
#import <RNReanimated/REAUtils.h>
|
|
2
6
|
#import <React/RCTConvert.h>
|
|
3
7
|
#import <React/RCTLog.h>
|
|
4
8
|
#import <React/RCTUIManager.h>
|
|
5
|
-
#import "REAModule.h"
|
|
6
|
-
#import "REANodesManager.h"
|
|
7
|
-
#import "REAStyleNode.h"
|
|
8
|
-
#import "REAUtils.h"
|
|
9
9
|
|
|
10
10
|
@implementation REAAlwaysNode {
|
|
11
11
|
NSNumber *_nodeToBeEvaluated;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
#import <RNReanimated/REABezierNode.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
|
+
#import <RNReanimated/REAUtils.h>
|
|
3
4
|
#import <React/RCTConvert.h>
|
|
4
5
|
#import <React/RCTLog.h>
|
|
5
|
-
#
|
|
6
|
-
#import "REANodesManager.h"
|
|
7
|
-
#import "REAUtils.h"
|
|
6
|
+
#include <tgmath.h>
|
|
8
7
|
|
|
9
8
|
#define EPS 1e-5
|
|
10
9
|
|
package/ios/Nodes/REABlockNode.h
CHANGED
package/ios/Nodes/REABlockNode.m
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
#import
|
|
4
|
-
#import
|
|
5
|
-
#import
|
|
6
|
-
#import
|
|
7
|
-
#import
|
|
3
|
+
#import <RNReanimated/REACallFuncNode.h>
|
|
4
|
+
#import <RNReanimated/REAFunctionNode.h>
|
|
5
|
+
#import <RNReanimated/REANodesManager.h>
|
|
6
|
+
#import <RNReanimated/REAParamNode.h>
|
|
7
|
+
#import <RNReanimated/REAUtils.h>
|
|
8
8
|
|
|
9
9
|
@implementation REACallFuncNode {
|
|
10
10
|
NSNumber *_whatNodeID;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAClockNodes.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
|
+
#import <RNReanimated/REAParamNode.h>
|
|
4
|
+
#import <RNReanimated/REAUtils.h>
|
|
2
5
|
#import <React/RCTConvert.h>
|
|
3
6
|
#import <React/RCTLog.h>
|
|
4
|
-
#import "REANodesManager.h"
|
|
5
|
-
#import "REAParamNode.h"
|
|
6
|
-
#import "REAUtils.h"
|
|
7
7
|
|
|
8
8
|
@interface REAClockNode ()
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#import
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAConcatNode.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
|
+
#import <RNReanimated/REAValueNode.h>
|
|
4
4
|
|
|
5
5
|
@implementation REAConcatNode {
|
|
6
6
|
NSArray<NSNumber *> *_input;
|
package/ios/Nodes/REACondNode.h
CHANGED
package/ios/Nodes/REACondNode.m
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/REACondNode.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
|
+
#import <RNReanimated/REAUtils.h>
|
|
2
4
|
#import <React/RCTConvert.h>
|
|
3
5
|
#import <React/RCTLog.h>
|
|
4
|
-
#import "REANodesManager.h"
|
|
5
|
-
#import "REAUtils.h"
|
|
6
6
|
|
|
7
7
|
@implementation REACondNode {
|
|
8
8
|
NSNumber *_condNodeID;
|
package/ios/Nodes/READebugNode.h
CHANGED
package/ios/Nodes/READebugNode.m
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#import
|
|
1
|
+
#import <RNReanimated/READebugNode.h>
|
|
2
|
+
#import <RNReanimated/REANodesManager.h>
|
|
3
|
+
#import <RNReanimated/REAUtils.h>
|
|
2
4
|
#import <React/RCTConvert.h>
|
|
3
5
|
#import <React/RCTLog.h>
|
|
4
|
-
#import "REANodesManager.h"
|
|
5
|
-
#import "REAUtils.h"
|
|
6
6
|
|
|
7
7
|
@implementation READebugNode {
|
|
8
8
|
NSNumber *_valueNodeID;
|
package/ios/Nodes/REAEventNode.h
CHANGED
package/ios/Nodes/REAEventNode.m
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
4
|
-
#import
|
|
2
|
+
#import <RNReanimated/REAFunctionNode.h>
|
|
3
|
+
#import <RNReanimated/REANodesManager.h>
|
|
4
|
+
#import <RNReanimated/REAParamNode.h>
|
|
5
5
|
|
|
6
6
|
@implementation REAFunctionNode {
|
|
7
7
|
NSNumber *_nodeToBeEvaluated;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#import
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
1
|
+
#import <RNReanimated/REAJSCallNode.h>
|
|
2
|
+
#import <RNReanimated/REAModule.h>
|
|
3
|
+
#import <RNReanimated/REANodesManager.h>
|
|
4
4
|
|
|
5
5
|
@implementation REAJSCallNode {
|
|
6
6
|
NSArray<NSNumber *> *_input;
|
package/ios/Nodes/REANode.m
CHANGED