react-native-reanimated 3.8.0 → 3.9.0-layout-animation-experimental
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/Fabric/ShadowTreeCloner.cpp +5 -2
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp +42 -32
- package/Common/cpp/LayoutAnimations/LayoutAnimationsManager.h +5 -7
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.cpp +565 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsProxy.h +74 -0
- package/Common/cpp/LayoutAnimations/LayoutAnimationsUtils.h +140 -0
- package/Common/cpp/NativeModules/NativeReanimatedModule.cpp +216 -58
- package/Common/cpp/NativeModules/NativeReanimatedModule.h +32 -11
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp +2 -17
- package/Common/cpp/NativeModules/NativeReanimatedModuleSpec.h +6 -8
- package/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp +3 -0
- package/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp +3 -4
- package/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp +8 -3
- package/Common/cpp/SharedItems/Shareables.cpp +31 -5
- package/Common/cpp/SharedItems/Shareables.h +18 -2
- package/Common/cpp/Tools/JSScheduler.cpp +29 -5
- package/Common/cpp/Tools/JSScheduler.h +21 -4
- package/Common/cpp/Tools/PlatformDepMethodsHolder.h +6 -2
- package/Common/cpp/Tools/UIRuntimeDecorator.cpp +6 -0
- package/Common/cpp/Tools/UIRuntimeDecorator.h +1 -0
- package/android/CMakeLists.txt +3 -0
- package/android/build.gradle +17 -5
- package/android/src/main/cpp/NativeProxy.cpp +77 -12
- package/android/src/main/cpp/NativeProxy.h +35 -1
- package/android/src/main/java/com/swmansion/reanimated/NodesManager.java +58 -19
- package/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +7 -2
- package/android/src/{reactNativeVersionPatch/ReanimatedUIManager/latest → main/java}/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +5 -5
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java +10 -6
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedNativeHierarchyManager.java +18 -1
- package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/SharedTransitionManager.java +105 -17
- package/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +2 -1
- package/android/src/paper/java/com/swmansion/reanimated/NativeReanimatedModuleSpec.java +37 -0
- package/android/src/{main/java/com/swmansion/reanimated → reactNativeVersionPatch/ReanimatedUIManager/73/com/swmansion}/ReanimatedModule.java +4 -3
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/{70 → 73}/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +1 -22
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/ReanimatedModule.java +176 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/latest/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java +0 -26
- package/android/src/{fabric/java → reactNativeVersionPatch/RuntimeExecutor/73}/com/swmansion/reanimated/NativeProxy.java +16 -4
- package/android/src/reactNativeVersionPatch/RuntimeExecutor/latest/com/swmansion/reanimated/NativeProxy.java +143 -0
- package/apple/LayoutReanimation/REAAnimationsManager.h +3 -0
- package/apple/LayoutReanimation/REAAnimationsManager.m +11 -0
- package/apple/LayoutReanimation/REASharedTransitionManager.m +99 -23
- package/apple/LayoutReanimation/REASnapshot.h +1 -0
- package/apple/LayoutReanimation/REASnapshot.m +78 -37
- package/apple/REAModule.h +22 -2
- package/apple/REAModule.mm +97 -46
- package/apple/REANodesManager.h +3 -3
- package/apple/REANodesManager.mm +46 -22
- package/apple/native/NativeProxy.h +28 -2
- package/apple/native/NativeProxy.mm +65 -195
- package/apple/native/PlatformDepMethodsHolderImpl.h +59 -0
- package/apple/native/PlatformDepMethodsHolderImpl.mm +429 -0
- package/apple/sensor/ReanimatedSensor.m +5 -5
- package/lib/module/Animated.js.map +1 -1
- package/lib/module/ConfigHelper.js +1 -1
- package/lib/module/ConfigHelper.js.map +1 -1
- package/lib/module/animationBuilder.js +1 -0
- package/lib/module/animationBuilder.js.map +1 -1
- package/lib/module/createAnimatedComponent/InlinePropManager.js +4 -4
- package/lib/module/createAnimatedComponent/InlinePropManager.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js +9 -6
- package/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +1 -1
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js +11 -0
- package/lib/module/createAnimatedComponent/JSPropsUpdater.web.js.map +1 -0
- package/lib/module/createAnimatedComponent/PropsFilter.js +25 -9
- package/lib/module/createAnimatedComponent/PropsFilter.js.map +1 -1
- package/lib/module/createAnimatedComponent/commonTypes.js.map +1 -1
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js +83 -52
- package/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +1 -1
- package/lib/module/createAnimatedComponent/getViewInfo.js +37 -0
- package/lib/module/createAnimatedComponent/getViewInfo.js.map +1 -0
- package/lib/module/createAnimatedComponent/index.js.map +1 -1
- package/lib/module/createAnimatedComponent/setAndForwardRef.js +4 -5
- package/lib/module/createAnimatedComponent/setAndForwardRef.js.map +1 -1
- package/lib/module/createAnimatedComponent/utils.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/mock.js +12 -12
- package/lib/module/mock.js.map +1 -1
- package/lib/module/propsAllowlists.js.map +1 -1
- package/lib/module/reanimated2/Bezier.js.map +1 -1
- package/lib/module/reanimated2/Colors.js +4 -11
- package/lib/module/reanimated2/Colors.js.map +1 -1
- package/lib/module/reanimated2/Easing.js +3 -7
- package/lib/module/reanimated2/Easing.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js +16 -13
- package/lib/module/reanimated2/NativeReanimated/NativeReanimated.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.js.map +1 -1
- package/lib/module/reanimated2/NativeReanimated/index.web.js.map +1 -1
- package/lib/module/reanimated2/PlatformChecker.js +2 -1
- package/lib/module/reanimated2/PlatformChecker.js.map +1 -1
- package/lib/module/reanimated2/PropAdapters.js +1 -1
- package/lib/module/reanimated2/PropAdapters.js.map +1 -1
- package/lib/module/reanimated2/PropsRegistry.js +1 -2
- package/lib/module/reanimated2/PropsRegistry.js.map +1 -1
- package/lib/module/reanimated2/Sensor.js +2 -2
- package/lib/module/reanimated2/Sensor.js.map +1 -1
- package/lib/module/reanimated2/SensorContainer.js +2 -2
- package/lib/module/reanimated2/SensorContainer.js.map +1 -1
- package/lib/module/reanimated2/UpdateLayoutAnimations.js +30 -8
- package/lib/module/reanimated2/UpdateLayoutAnimations.js.map +1 -1
- package/lib/module/reanimated2/UpdateProps.js.map +1 -1
- package/lib/module/reanimated2/ViewDescriptorsSet.js.map +1 -1
- package/lib/module/reanimated2/WorkletEventHandler.js +74 -31
- package/lib/module/reanimated2/WorkletEventHandler.js.map +1 -1
- package/lib/module/reanimated2/animation/clamp.js.map +1 -1
- package/lib/module/reanimated2/animation/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/decay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/index.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rigidDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/rubberBandDecay.js.map +1 -1
- package/lib/module/reanimated2/animation/decay/utils.js.map +1 -1
- package/lib/module/reanimated2/animation/delay.js.map +1 -1
- package/lib/module/reanimated2/animation/index.js.map +1 -1
- package/lib/module/reanimated2/animation/repeat.js +1 -6
- package/lib/module/reanimated2/animation/repeat.js.map +1 -1
- package/lib/module/reanimated2/animation/sequence.js +1 -5
- package/lib/module/reanimated2/animation/sequence.js.map +1 -1
- package/lib/module/reanimated2/animation/spring.js.map +1 -1
- package/lib/module/reanimated2/animation/springUtils.js +8 -10
- package/lib/module/reanimated2/animation/springUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/styleAnimation.js +5 -4
- package/lib/module/reanimated2/animation/styleAnimation.js.map +1 -1
- package/lib/module/reanimated2/animation/timing.js +4 -1
- package/lib/module/reanimated2/animation/timing.js.map +1 -1
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js +1 -2
- package/lib/module/reanimated2/animation/transformationMatrix/matrixUtils.js.map +1 -1
- package/lib/module/reanimated2/animation/util.js +22 -2
- package/lib/module/reanimated2/animation/util.js.map +1 -1
- package/lib/module/reanimated2/commonTypes.js +3 -1
- package/lib/module/reanimated2/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/component/FlatList.js +1 -0
- package/lib/module/reanimated2/component/FlatList.js.map +1 -1
- package/lib/module/reanimated2/component/Image.js +1 -0
- package/lib/module/reanimated2/component/Image.js.map +1 -1
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js +1 -0
- package/lib/module/reanimated2/component/LayoutAnimationConfig.js.map +1 -1
- package/lib/module/reanimated2/component/PerformanceMonitor.js +169 -0
- package/lib/module/reanimated2/component/PerformanceMonitor.js.map +1 -0
- package/lib/module/reanimated2/component/ScrollView.js +1 -0
- package/lib/module/reanimated2/component/ScrollView.js.map +1 -1
- package/lib/module/reanimated2/component/Text.js +1 -0
- package/lib/module/reanimated2/component/Text.js.map +1 -1
- package/lib/module/reanimated2/component/View.js +1 -0
- package/lib/module/reanimated2/component/View.js.map +1 -1
- package/lib/module/reanimated2/core.js +6 -15
- package/lib/module/reanimated2/core.js.map +1 -1
- package/lib/module/reanimated2/errors.js +8 -8
- package/lib/module/reanimated2/errors.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.js +33 -8
- package/lib/module/reanimated2/fabricUtils.js.map +1 -1
- package/lib/module/reanimated2/fabricUtils.web.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js +2 -2
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryJS.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/FrameCallbackRegistryUI.js.map +1 -1
- package/lib/module/reanimated2/frameCallback/index.js.map +1 -1
- package/lib/module/reanimated2/globals.d.js.map +1 -1
- package/lib/module/reanimated2/helperTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/hook/index.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedGestureHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js +3 -4
- package/lib/module/reanimated2/hook/useAnimatedKeyboard.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedProps.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedReaction.js +1 -0
- package/lib/module/reanimated2/hook/useAnimatedReaction.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedRef.js +12 -7
- package/lib/module/reanimated2/hook/useAnimatedRef.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js +3 -1
- package/lib/module/reanimated2/hook/useAnimatedScrollHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedSensor.js.map +1 -1
- package/lib/module/reanimated2/hook/useAnimatedStyle.js +3 -6
- package/lib/module/reanimated2/hook/useAnimatedStyle.js.map +1 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js +3 -1
- package/lib/module/reanimated2/hook/useDerivedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useEvent.js +4 -5
- package/lib/module/reanimated2/hook/useEvent.js.map +1 -1
- package/lib/module/reanimated2/hook/useFrameCallback.js +1 -2
- package/lib/module/reanimated2/hook/useFrameCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/useHandler.js +3 -1
- package/lib/module/reanimated2/hook/useHandler.js.map +1 -1
- package/lib/module/reanimated2/hook/useReducedMotion.js.map +1 -1
- package/lib/module/reanimated2/hook/useScrollViewOffset.js +60 -16
- package/lib/module/reanimated2/hook/useScrollViewOffset.js.map +1 -1
- package/lib/module/reanimated2/hook/useSharedValue.js.map +1 -1
- package/lib/module/reanimated2/hook/useWorkletCallback.js.map +1 -1
- package/lib/module/reanimated2/hook/utils.js.map +1 -1
- package/lib/module/reanimated2/index.js +2 -0
- package/lib/module/reanimated2/index.js.map +1 -1
- package/lib/module/reanimated2/initializers.js +1 -5
- package/lib/module/reanimated2/initializers.js.map +1 -1
- package/lib/module/reanimated2/interpolateColor.js +2 -6
- package/lib/module/reanimated2/interpolateColor.js.map +1 -1
- package/lib/module/reanimated2/interpolation.js +1 -1
- package/lib/module/reanimated2/interpolation.js.map +1 -1
- package/lib/module/reanimated2/isSharedValue.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.js +3 -6
- package/lib/module/reanimated2/jestUtils.js.map +1 -1
- package/lib/module/reanimated2/jestUtils.web.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js +5 -9
- package/lib/module/reanimated2/js-reanimated/JSReanimated.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/WebSensor.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/index.js +2 -2
- package/lib/module/reanimated2/js-reanimated/index.js.map +1 -1
- package/lib/module/reanimated2/js-reanimated/react-native-web.d.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js +4 -2
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/BaseAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js +12 -11
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js +12 -10
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/Keyframe.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/commonTypes.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationBuilder/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js +11 -4
- package/lib/module/reanimated2/layoutReanimation/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Bounce.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js +22 -22
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Fade.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js +26 -26
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Flip.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Lightspeed.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js +6 -6
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Pinwheel.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Roll.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Rotate.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js +18 -18
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Slide.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js +10 -10
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Stretch.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js +34 -34
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/Zoom.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultAnimations/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js +17 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/EntryExitTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/FadingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/JumpingTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/LinearTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/SequencedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/defaultTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js +16 -12
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js +13 -7
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/sharedTransitions/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Bounce.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Fade.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Flip.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Lightspeed.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Pinwheel.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Roll.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Rotate.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Slide.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Stretch.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animation/Zoom.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js +0 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationParser.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js +1 -2
- package/lib/module/reanimated2/layoutReanimation/web/animationsManager.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js +3 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentStyle.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js +6 -7
- package/lib/module/reanimated2/layoutReanimation/web/componentUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/config.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js +2 -2
- package/lib/module/reanimated2/layoutReanimation/web/createAnimation.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js +4 -4
- package/lib/module/reanimated2/layoutReanimation/web/domUtils.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/index.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Fading.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Linear.web.js.map +1 -1
- package/lib/module/reanimated2/layoutReanimation/web/transition/Sequenced.web.js.map +1 -1
- package/lib/module/reanimated2/mappers.js +2 -4
- package/lib/module/reanimated2/mappers.js.map +1 -1
- package/lib/module/reanimated2/mockedRequestAnimationFrame.js.map +1 -1
- package/lib/module/reanimated2/mutables.js +2 -4
- package/lib/module/reanimated2/mutables.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/RNRenderer.web.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/checkCppVersion.js.map +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js +1 -1
- package/lib/module/reanimated2/platform-specific/jsVersion.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js +2 -4
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/dispatchCommand.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js +2 -2
- package/lib/module/reanimated2/platformFunctions/getRelativeCoords.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/index.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/measure.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js +1 -1
- package/lib/module/reanimated2/platformFunctions/scrollTo.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setGestureState.web.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.js.map +1 -1
- package/lib/module/reanimated2/platformFunctions/setNativeProps.web.js.map +1 -1
- package/lib/module/reanimated2/pluginUtils.js.map +1 -1
- package/lib/module/reanimated2/publicGlobals.js.map +1 -1
- package/lib/module/reanimated2/runtimes.js +11 -19
- package/lib/module/reanimated2/runtimes.js.map +1 -1
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js +20 -0
- package/lib/module/reanimated2/screenTransition/RNScreensTurboModule.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js +41 -0
- package/lib/module/reanimated2/screenTransition/animationManager.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js +4 -0
- package/lib/module/reanimated2/screenTransition/commonTypes.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/index.js +5 -0
- package/lib/module/reanimated2/screenTransition/index.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/presets.js +157 -0
- package/lib/module/reanimated2/screenTransition/presets.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js +62 -0
- package/lib/module/reanimated2/screenTransition/styleUpdater.js.map +1 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js +190 -0
- package/lib/module/reanimated2/screenTransition/swipeSimulator.js.map +1 -0
- package/lib/module/reanimated2/shareableMappingCache.js.map +1 -1
- package/lib/module/reanimated2/shareables.js +27 -10
- package/lib/module/reanimated2/shareables.js.map +1 -1
- package/lib/module/reanimated2/threads.js +9 -34
- package/lib/module/reanimated2/threads.js.map +1 -1
- package/lib/module/reanimated2/valueSetter.js +1 -2
- package/lib/module/reanimated2/valueSetter.js.map +1 -1
- package/lib/module/reanimated2/valueUnpacker.js +4 -3
- package/lib/module/reanimated2/valueUnpacker.js.map +1 -1
- package/lib/module/specs/NativeReanimatedModule.js +5 -0
- package/lib/module/specs/NativeReanimatedModule.js.map +1 -0
- package/lib/typescript/ConfigHelper.d.ts +1 -0
- package/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +1 -1
- package/lib/typescript/createAnimatedComponent/JSPropsUpdater.web.d.ts +6 -0
- package/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +3 -0
- package/lib/typescript/createAnimatedComponent/getViewInfo.d.ts +9 -0
- package/lib/typescript/reanimated2/NativeReanimated/NativeReanimated.d.ts +8 -13
- package/lib/typescript/reanimated2/UpdateLayoutAnimations.d.ts +12 -1
- package/lib/typescript/reanimated2/WorkletEventHandler.d.ts +16 -9
- package/lib/typescript/reanimated2/animation/util.d.ts +2 -0
- package/lib/typescript/reanimated2/component/LayoutAnimationConfig.d.ts +1 -1
- package/lib/typescript/reanimated2/component/PerformanceMonitor.d.ts +2 -0
- package/lib/typescript/reanimated2/core.d.ts +3 -4
- package/lib/typescript/reanimated2/hook/commonTypes.d.ts +6 -0
- package/lib/typescript/reanimated2/hook/useEvent.d.ts +2 -3
- package/lib/typescript/reanimated2/hook/useScrollViewOffset.d.ts +3 -1
- package/lib/typescript/reanimated2/index.d.ts +3 -0
- package/lib/typescript/reanimated2/js-reanimated/JSReanimated.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/animationBuilder/commonTypes.d.ts +2 -1
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.d.ts +2 -2
- package/lib/typescript/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.d.ts +2 -2
- package/lib/typescript/reanimated2/platform-specific/jsVersion.d.ts +1 -1
- package/lib/typescript/reanimated2/screenTransition/RNScreensTurboModule.d.ts +2 -0
- package/lib/typescript/reanimated2/screenTransition/animationManager.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/commonTypes.d.ts +38 -0
- package/lib/typescript/reanimated2/screenTransition/index.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/presets.d.ts +11 -0
- package/lib/typescript/reanimated2/screenTransition/styleUpdater.d.ts +3 -0
- package/lib/typescript/reanimated2/screenTransition/swipeSimulator.d.ts +2 -0
- package/lib/typescript/specs/NativeReanimatedModule.d.ts +6 -0
- package/package.json +29 -17
- package/plugin/build/plugin.js +7 -2
- package/src/ConfigHelper.ts +1 -1
- package/src/animationBuilder.tsx +2 -0
- package/src/createAnimatedComponent/InlinePropManager.ts +2 -2
- package/src/createAnimatedComponent/JSPropsUpdater.ts +7 -6
- package/src/createAnimatedComponent/JSPropsUpdater.web.ts +26 -0
- package/src/createAnimatedComponent/PropsFilter.tsx +31 -6
- package/src/createAnimatedComponent/createAnimatedComponent.tsx +108 -60
- package/src/createAnimatedComponent/getViewInfo.ts +39 -0
- package/src/mock.ts +13 -1
- package/src/reanimated2/NativeReanimated/NativeReanimated.ts +33 -35
- package/src/reanimated2/PlatformChecker.ts +3 -2
- package/src/reanimated2/PropsRegistry.ts +1 -3
- package/src/reanimated2/UpdateLayoutAnimations.ts +53 -13
- package/src/reanimated2/WorkletEventHandler.ts +98 -39
- package/src/reanimated2/animation/styleAnimation.ts +8 -6
- package/src/reanimated2/animation/timing.ts +9 -1
- package/src/reanimated2/animation/util.ts +28 -3
- package/src/reanimated2/commonTypes.ts +4 -1
- package/src/reanimated2/component/PerformanceMonitor.tsx +216 -0
- package/src/reanimated2/core.ts +9 -31
- package/src/reanimated2/errors.ts +1 -0
- package/src/reanimated2/fabricUtils.ts +43 -18
- package/src/reanimated2/globals.d.ts +11 -1
- package/src/reanimated2/hook/commonTypes.ts +10 -0
- package/src/reanimated2/hook/useAnimatedRef.ts +20 -11
- package/src/reanimated2/hook/useEvent.ts +4 -4
- package/src/reanimated2/hook/useScrollViewOffset.ts +94 -23
- package/src/reanimated2/index.ts +11 -0
- package/src/reanimated2/js-reanimated/JSReanimated.ts +7 -7
- package/src/reanimated2/layoutReanimation/animationBuilder/ComplexAnimationBuilder.ts +4 -0
- package/src/reanimated2/layoutReanimation/animationBuilder/Keyframe.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationBuilder/commonTypes.ts +9 -1
- package/src/reanimated2/layoutReanimation/animationsManager.ts +10 -2
- package/src/reanimated2/layoutReanimation/defaultTransitions/CurvedTransition.ts +13 -0
- package/src/reanimated2/layoutReanimation/sharedTransitions/ProgressTransitionManager.ts +17 -8
- package/src/reanimated2/layoutReanimation/sharedTransitions/SharedTransition.ts +26 -7
- package/src/reanimated2/layoutReanimation/web/animationsManager.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/componentStyle.ts +3 -1
- package/src/reanimated2/layoutReanimation/web/componentUtils.ts +1 -1
- package/src/reanimated2/layoutReanimation/web/createAnimation.ts +2 -2
- package/src/reanimated2/platform-specific/jsVersion.ts +1 -1
- package/src/reanimated2/platformFunctions/getRelativeCoords.ts +2 -2
- package/src/reanimated2/screenTransition/RNScreensTurboModule.ts +29 -0
- package/src/reanimated2/screenTransition/animationManager.ts +45 -0
- package/src/reanimated2/screenTransition/commonTypes.ts +63 -0
- package/src/reanimated2/screenTransition/index.ts +12 -0
- package/src/reanimated2/screenTransition/presets.ts +137 -0
- package/src/reanimated2/screenTransition/styleUpdater.ts +73 -0
- package/src/reanimated2/screenTransition/swipeSimulator.ts +238 -0
- package/src/reanimated2/shareables.ts +29 -6
- package/src/reanimated2/valueUnpacker.ts +10 -3
- package/src/specs/NativeReanimatedModule.ts +9 -0
- package/android/src/reactNativeVersionPatch/ReanimatedUIManager/70/com/swmansion/reanimated/ReanimatedUIManagerFactory.java +0 -16
- package/android/src/reactNativeVersionPatch/messageQueueThread/67/com/swmansion/reanimated/ReanimatedMessageQueueThread.java +0 -12
|
@@ -44,13 +44,48 @@ NativeProxy::NativeProxy(
|
|
|
44
44
|
rnRuntime_(rnRuntime),
|
|
45
45
|
nativeReanimatedModule_(std::make_shared<NativeReanimatedModule>(
|
|
46
46
|
*rnRuntime,
|
|
47
|
-
jsCallInvoker,
|
|
47
|
+
std::make_shared<JSScheduler>(*rnRuntime, jsCallInvoker),
|
|
48
48
|
std::make_shared<JMessageQueueThread>(messageQueueThread),
|
|
49
49
|
uiScheduler,
|
|
50
50
|
getPlatformDependentMethods(),
|
|
51
|
-
valueUnpackerCode
|
|
51
|
+
valueUnpackerCode,
|
|
52
|
+
/* isBridgeless */ false)),
|
|
52
53
|
layoutAnimations_(std::move(layoutAnimations)) {
|
|
53
54
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
55
|
+
commonInit(fabricUIManager);
|
|
56
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
60
|
+
NativeProxy::NativeProxy(
|
|
61
|
+
jni::alias_ref<NativeProxy::javaobject> jThis,
|
|
62
|
+
jsi::Runtime *rnRuntime,
|
|
63
|
+
RuntimeExecutor runtimeExecutor,
|
|
64
|
+
const std::shared_ptr<UIScheduler> &uiScheduler,
|
|
65
|
+
jni::global_ref<LayoutAnimations::javaobject> layoutAnimations,
|
|
66
|
+
jni::alias_ref<JavaMessageQueueThread::javaobject> messageQueueThread,
|
|
67
|
+
jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
68
|
+
fabricUIManager,
|
|
69
|
+
const std::string &valueUnpackerCode)
|
|
70
|
+
: javaPart_(jni::make_global(jThis)),
|
|
71
|
+
rnRuntime_(rnRuntime),
|
|
72
|
+
nativeReanimatedModule_(std::make_shared<NativeReanimatedModule>(
|
|
73
|
+
*rnRuntime,
|
|
74
|
+
std::make_shared<JSScheduler>(*rnRuntime, runtimeExecutor),
|
|
75
|
+
std::make_shared<JMessageQueueThread>(messageQueueThread),
|
|
76
|
+
uiScheduler,
|
|
77
|
+
getPlatformDependentMethods(),
|
|
78
|
+
valueUnpackerCode,
|
|
79
|
+
/* isBridgeless */ true)),
|
|
80
|
+
layoutAnimations_(std::move(layoutAnimations)) {
|
|
81
|
+
commonInit(fabricUIManager);
|
|
82
|
+
}
|
|
83
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
84
|
+
|
|
85
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
86
|
+
void NativeProxy::commonInit(
|
|
87
|
+
jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
88
|
+
&fabricUIManager) {
|
|
54
89
|
const auto &uiManager =
|
|
55
90
|
fabricUIManager->getBinding()->getScheduler()->getUIManager();
|
|
56
91
|
nativeReanimatedModule_->initializeFabric(uiManager);
|
|
@@ -63,8 +98,8 @@ NativeProxy::NativeProxy(
|
|
|
63
98
|
// });
|
|
64
99
|
// reactScheduler_ = binding->getScheduler();
|
|
65
100
|
// reactScheduler_->addEventListener(eventListener_);
|
|
66
|
-
#endif
|
|
67
101
|
}
|
|
102
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
68
103
|
|
|
69
104
|
NativeProxy::~NativeProxy() {
|
|
70
105
|
// removed temporary, new event listener mechanism need fix on the RN side
|
|
@@ -104,6 +139,31 @@ jni::local_ref<NativeProxy::jhybriddata> NativeProxy::initHybrid(
|
|
|
104
139
|
valueUnpackerCode);
|
|
105
140
|
}
|
|
106
141
|
|
|
142
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
143
|
+
jni::local_ref<NativeProxy::jhybriddata> NativeProxy::initHybridBridgeless(
|
|
144
|
+
jni::alias_ref<jhybridobject> jThis,
|
|
145
|
+
jlong jsContext,
|
|
146
|
+
jni::alias_ref<react::JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
|
147
|
+
jni::alias_ref<AndroidUIScheduler::javaobject> androidUiScheduler,
|
|
148
|
+
jni::alias_ref<LayoutAnimations::javaobject> layoutAnimations,
|
|
149
|
+
jni::alias_ref<JavaMessageQueueThread::javaobject> messageQueueThread,
|
|
150
|
+
jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
151
|
+
fabricUIManager,
|
|
152
|
+
const std::string &valueUnpackerCode) {
|
|
153
|
+
auto uiScheduler = androidUiScheduler->cthis()->getUIScheduler();
|
|
154
|
+
auto runtimeExecutor = runtimeExecutorHolder->cthis()->get();
|
|
155
|
+
return makeCxxInstance(
|
|
156
|
+
jThis,
|
|
157
|
+
(jsi::Runtime *)jsContext,
|
|
158
|
+
runtimeExecutor,
|
|
159
|
+
uiScheduler,
|
|
160
|
+
make_global(layoutAnimations),
|
|
161
|
+
messageQueueThread,
|
|
162
|
+
fabricUIManager,
|
|
163
|
+
valueUnpackerCode);
|
|
164
|
+
}
|
|
165
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
166
|
+
|
|
107
167
|
#ifndef NDEBUG
|
|
108
168
|
void NativeProxy::checkJavaVersion(jsi::Runtime &rnRuntime) {
|
|
109
169
|
std::string javaVersion;
|
|
@@ -177,13 +237,18 @@ bool NativeProxy::getIsReducedMotion() {
|
|
|
177
237
|
}
|
|
178
238
|
|
|
179
239
|
void NativeProxy::registerNatives() {
|
|
180
|
-
registerHybrid(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
240
|
+
registerHybrid({
|
|
241
|
+
makeNativeMethod("initHybrid", NativeProxy::initHybrid),
|
|
242
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
243
|
+
makeNativeMethod(
|
|
244
|
+
"initHybridBridgeless", NativeProxy::initHybridBridgeless),
|
|
245
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
246
|
+
makeNativeMethod("installJSIBindings", NativeProxy::installJSIBindings),
|
|
247
|
+
makeNativeMethod(
|
|
248
|
+
"isAnyHandlerWaitingForEvent",
|
|
249
|
+
NativeProxy::isAnyHandlerWaitingForEvent),
|
|
250
|
+
makeNativeMethod("performOperations", NativeProxy::performOperations)
|
|
251
|
+
});
|
|
187
252
|
}
|
|
188
253
|
|
|
189
254
|
void NativeProxy::requestRender(
|
|
@@ -216,12 +281,12 @@ void NativeProxy::maybeFlushUIUpdatesQueue() {
|
|
|
216
281
|
jsi::Value NativeProxy::obtainProp(
|
|
217
282
|
jsi::Runtime &rt,
|
|
218
283
|
const int viewTag,
|
|
219
|
-
const jsi::
|
|
284
|
+
const jsi::Value &propName) {
|
|
220
285
|
static const auto method =
|
|
221
286
|
getJniMethod<jni::local_ref<JString>(int, jni::local_ref<JString>)>(
|
|
222
287
|
"obtainProp");
|
|
223
288
|
local_ref<JString> propNameJStr =
|
|
224
|
-
jni::make_jstring(propName.utf8(rt).c_str());
|
|
289
|
+
jni::make_jstring(propName.asString(rt).utf8(rt).c_str());
|
|
225
290
|
auto result = method(javaPart_.get(), viewTag, propNameJStr);
|
|
226
291
|
std::string str = result->toStdString();
|
|
227
292
|
return jsi::Value(rt, jsi::String::createFromAscii(rt, str));
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
4
|
#include <react/fabric/JFabricUIManager.h>
|
|
5
5
|
#include <react/renderer/scheduler/Scheduler.h>
|
|
6
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74
|
|
7
|
+
#include <react/jni/JRuntimeExecutor.h>
|
|
8
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74
|
|
6
9
|
#endif
|
|
7
10
|
|
|
8
11
|
#include <ReactCommon/CallInvokerHolder.h>
|
|
@@ -158,6 +161,19 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
|
|
|
158
161
|
fabricUIManager,
|
|
159
162
|
#endif
|
|
160
163
|
const std::string &valueUnpackerCode);
|
|
164
|
+
|
|
165
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
166
|
+
static jni::local_ref<jhybriddata> initHybridBridgeless(
|
|
167
|
+
jni::alias_ref<jhybridobject> jThis,
|
|
168
|
+
jlong jsContext,
|
|
169
|
+
jni::alias_ref<react::JRuntimeExecutor::javaobject> runtimeExecutorHolder,
|
|
170
|
+
jni::alias_ref<AndroidUIScheduler::javaobject> androidUiScheduler,
|
|
171
|
+
jni::alias_ref<LayoutAnimations::javaobject> layoutAnimations,
|
|
172
|
+
jni::alias_ref<JavaMessageQueueThread::javaobject> messageQueueThread,
|
|
173
|
+
jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
174
|
+
fabricUIManager,
|
|
175
|
+
const std::string &valueUnpackerCode);
|
|
176
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
161
177
|
static void registerNatives();
|
|
162
178
|
|
|
163
179
|
~NativeProxy();
|
|
@@ -211,7 +227,7 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
|
|
|
211
227
|
// nothing
|
|
212
228
|
#else
|
|
213
229
|
jsi::Value
|
|
214
|
-
obtainProp(jsi::Runtime &rt, const int viewTag, const jsi::
|
|
230
|
+
obtainProp(jsi::Runtime &rt, const int viewTag, const jsi::Value &propName);
|
|
215
231
|
void configureProps(
|
|
216
232
|
jsi::Runtime &rt,
|
|
217
233
|
const jsi::Value &uiProps,
|
|
@@ -269,6 +285,24 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
|
|
|
269
285
|
fabricUIManager,
|
|
270
286
|
#endif
|
|
271
287
|
const std::string &valueUnpackerCode);
|
|
288
|
+
|
|
289
|
+
#if REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED)
|
|
290
|
+
explicit NativeProxy(
|
|
291
|
+
jni::alias_ref<NativeProxy::jhybridobject> jThis,
|
|
292
|
+
jsi::Runtime *rnRuntime,
|
|
293
|
+
RuntimeExecutor runtimeExecutor,
|
|
294
|
+
const std::shared_ptr<UIScheduler> &uiScheduler,
|
|
295
|
+
jni::global_ref<LayoutAnimations::javaobject> layoutAnimations,
|
|
296
|
+
jni::alias_ref<JavaMessageQueueThread::javaobject> messageQueueThread,
|
|
297
|
+
jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
298
|
+
fabricUIManager,
|
|
299
|
+
const std::string &valueUnpackerCode);
|
|
300
|
+
#endif // REACT_NATIVE_MINOR_VERSION >= 74 && defined(RCT_NEW_ARCH_ENABLED
|
|
301
|
+
|
|
302
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
303
|
+
void commonInit(jni::alias_ref<facebook::react::JFabricUIManager::javaobject>
|
|
304
|
+
&fabricUIManager);
|
|
305
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
272
306
|
};
|
|
273
307
|
|
|
274
308
|
} // namespace reanimated
|
|
@@ -2,6 +2,7 @@ package com.swmansion.reanimated;
|
|
|
2
2
|
|
|
3
3
|
import static java.lang.Float.NaN;
|
|
4
4
|
|
|
5
|
+
import android.graphics.drawable.Drawable;
|
|
5
6
|
import android.view.View;
|
|
6
7
|
import com.facebook.react.bridge.Arguments;
|
|
7
8
|
import com.facebook.react.bridge.GuardedRunnable;
|
|
@@ -11,6 +12,7 @@ import com.facebook.react.bridge.ReactContext;
|
|
|
11
12
|
import com.facebook.react.bridge.ReadableArray;
|
|
12
13
|
import com.facebook.react.bridge.ReadableMap;
|
|
13
14
|
import com.facebook.react.bridge.ReadableType;
|
|
15
|
+
import com.facebook.react.bridge.UIManager;
|
|
14
16
|
import com.facebook.react.bridge.UiThreadUtil;
|
|
15
17
|
import com.facebook.react.bridge.WritableArray;
|
|
16
18
|
import com.facebook.react.bridge.WritableMap;
|
|
@@ -18,14 +20,18 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
|
18
20
|
import com.facebook.react.modules.core.ReactChoreographer;
|
|
19
21
|
import com.facebook.react.uimanager.GuardedFrameCallback;
|
|
20
22
|
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
23
|
+
import com.facebook.react.uimanager.PixelUtil;
|
|
21
24
|
import com.facebook.react.uimanager.ReactShadowNode;
|
|
22
25
|
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
|
23
26
|
import com.facebook.react.uimanager.UIImplementation;
|
|
27
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
24
28
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
25
29
|
import com.facebook.react.uimanager.UIManagerReanimatedHelper;
|
|
30
|
+
import com.facebook.react.uimanager.common.UIManagerType;
|
|
26
31
|
import com.facebook.react.uimanager.events.Event;
|
|
27
32
|
import com.facebook.react.uimanager.events.EventDispatcherListener;
|
|
28
33
|
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
34
|
+
import com.facebook.react.views.view.ReactViewBackgroundDrawable;
|
|
29
35
|
import com.swmansion.reanimated.layoutReanimation.AnimationsManager;
|
|
30
36
|
import com.swmansion.reanimated.nativeProxy.NoopEventHandler;
|
|
31
37
|
import java.util.ArrayList;
|
|
@@ -33,6 +39,7 @@ import java.util.Collections;
|
|
|
33
39
|
import java.util.LinkedList;
|
|
34
40
|
import java.util.List;
|
|
35
41
|
import java.util.Map;
|
|
42
|
+
import java.util.Objects;
|
|
36
43
|
import java.util.Queue;
|
|
37
44
|
import java.util.Set;
|
|
38
45
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
@@ -81,7 +88,7 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
81
88
|
void onAnimationFrame(double timestampMs);
|
|
82
89
|
}
|
|
83
90
|
|
|
84
|
-
private AnimationsManager mAnimationManager;
|
|
91
|
+
private final AnimationsManager mAnimationManager;
|
|
85
92
|
private final UIImplementation mUIImplementation;
|
|
86
93
|
private final DeviceEventManagerModule.RCTDeviceEventEmitter mEventEmitter;
|
|
87
94
|
private final ReactChoreographer mReactChoreographer;
|
|
@@ -89,7 +96,7 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
89
96
|
protected final UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver;
|
|
90
97
|
private final AtomicBoolean mCallbackPosted = new AtomicBoolean();
|
|
91
98
|
private final ReactContext mContext;
|
|
92
|
-
private final
|
|
99
|
+
private final UIManager mUIManager;
|
|
93
100
|
private ReactApplicationContext mReactApplicationContext;
|
|
94
101
|
private RCTEventEmitter mCustomEventHandler = new NoopEventHandler();
|
|
95
102
|
private List<OnAnimationFrame> mFrameCallbacks = new ArrayList<>();
|
|
@@ -144,9 +151,15 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
144
151
|
|
|
145
152
|
public NodesManager(ReactContext context) {
|
|
146
153
|
mContext = context;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
154
|
+
int uiManagerType =
|
|
155
|
+
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED ? UIManagerType.FABRIC : UIManagerType.DEFAULT;
|
|
156
|
+
mUIManager = UIManagerHelper.getUIManager(context, uiManagerType);
|
|
157
|
+
assert mUIManager != null;
|
|
158
|
+
mUIImplementation =
|
|
159
|
+
mUIManager instanceof UIManagerModule
|
|
160
|
+
? ((UIManagerModule) mUIManager).getUIImplementation()
|
|
161
|
+
: null;
|
|
162
|
+
mCustomEventNamesResolver = mUIManager::resolveCustomDirectEventName;
|
|
150
163
|
mEventEmitter = context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class);
|
|
151
164
|
|
|
152
165
|
mReactChoreographer = ReactChoreographer.getInstance();
|
|
@@ -159,14 +172,15 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
159
172
|
};
|
|
160
173
|
|
|
161
174
|
// We register as event listener at the end, because we pass `this` and we haven't finished
|
|
162
|
-
//
|
|
175
|
+
// constructing an object yet.
|
|
163
176
|
// This lead to a crash described in
|
|
164
177
|
// https://github.com/software-mansion/react-native-reanimated/issues/604 which was caused by
|
|
165
178
|
// Nodes Manager being constructed on UI thread and registering for events.
|
|
166
179
|
// Events are handled in the native modules thread in the `onEventDispatch()` method.
|
|
167
180
|
// This method indirectly uses `mChoreographerCallback` which was created after event
|
|
168
181
|
// registration, creating race condition
|
|
169
|
-
|
|
182
|
+
Objects.requireNonNull(UIManagerHelper.getEventDispatcher(context, uiManagerType))
|
|
183
|
+
.addListener(this);
|
|
170
184
|
|
|
171
185
|
mAnimationManager = new AnimationsManager(mContext, mUIManager);
|
|
172
186
|
}
|
|
@@ -227,7 +241,8 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
227
241
|
NativeUpdateOperation op = copiedOperationsQueue.remove();
|
|
228
242
|
ReactShadowNode shadowNode = mUIImplementation.resolveShadowNode(op.mViewTag);
|
|
229
243
|
if (shadowNode != null) {
|
|
230
|
-
|
|
244
|
+
((UIManagerModule) mUIManager)
|
|
245
|
+
.updateView(op.mViewTag, shadowNode.getViewClass(), op.mNativeProps);
|
|
231
246
|
}
|
|
232
247
|
}
|
|
233
248
|
if (queueWasEmpty) {
|
|
@@ -242,7 +257,7 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
242
257
|
try {
|
|
243
258
|
semaphore.tryAcquire(16, TimeUnit.MILLISECONDS);
|
|
244
259
|
} catch (InterruptedException e) {
|
|
245
|
-
// if the thread is
|
|
260
|
+
// if the thread is interrupted we just continue and let the layout update happen
|
|
246
261
|
// asynchronously
|
|
247
262
|
}
|
|
248
263
|
}
|
|
@@ -390,17 +405,41 @@ public class NodesManager implements EventDispatcherListener {
|
|
|
390
405
|
}
|
|
391
406
|
|
|
392
407
|
public String obtainProp(int viewTag, String propName) {
|
|
393
|
-
View view
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
408
|
+
View view;
|
|
409
|
+
try {
|
|
410
|
+
view = mUIManager.resolveView(viewTag);
|
|
411
|
+
} catch (Exception e) {
|
|
412
|
+
throw new IllegalStateException("[Reanimated] Unable to resolve view");
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
switch (propName) {
|
|
416
|
+
case "opacity":
|
|
417
|
+
return Float.toString(view.getAlpha());
|
|
418
|
+
case "zIndex":
|
|
419
|
+
return Float.toString(view.getElevation());
|
|
420
|
+
case "width":
|
|
421
|
+
return Float.toString(PixelUtil.toDIPFromPixel(view.getWidth()));
|
|
422
|
+
case "height":
|
|
423
|
+
return Float.toString(PixelUtil.toDIPFromPixel(view.getHeight()));
|
|
424
|
+
case "top":
|
|
425
|
+
return Float.toString(PixelUtil.toDIPFromPixel(view.getTop()));
|
|
426
|
+
case "left":
|
|
427
|
+
return Float.toString(PixelUtil.toDIPFromPixel(view.getLeft()));
|
|
428
|
+
case "backgroundColor":
|
|
429
|
+
Drawable background = view.getBackground();
|
|
430
|
+
if (!(background instanceof ReactViewBackgroundDrawable)) {
|
|
431
|
+
return "unable to resolve background color";
|
|
432
|
+
}
|
|
433
|
+
int actualColor = ((ReactViewBackgroundDrawable) background).getColor();
|
|
434
|
+
String invertedColor = String.format("%08x", (0xFFFFFFFF & actualColor));
|
|
435
|
+
// By default transparency is first, color second
|
|
436
|
+
return "#" + invertedColor.substring(2, 8) + invertedColor.substring(0, 2);
|
|
437
|
+
default:
|
|
438
|
+
throw new IllegalArgumentException(
|
|
439
|
+
"[Reanimated] Attempted to get unsupported property"
|
|
440
|
+
+ propName
|
|
441
|
+
+ " with function `getViewProp`");
|
|
402
442
|
}
|
|
403
|
-
return result;
|
|
404
443
|
}
|
|
405
444
|
|
|
406
445
|
private static WritableMap copyReadableMap(ReadableMap map) {
|
|
@@ -11,9 +11,9 @@ import com.facebook.react.bridge.NativeModule;
|
|
|
11
11
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
12
12
|
import com.facebook.react.bridge.ReactMarker;
|
|
13
13
|
import com.facebook.react.module.annotations.ReactModule;
|
|
14
|
+
import com.facebook.react.module.annotations.ReactModuleList;
|
|
14
15
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
15
16
|
import com.facebook.react.module.model.ReactModuleInfoProvider;
|
|
16
|
-
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
17
17
|
import com.facebook.react.uimanager.ReanimatedUIManager;
|
|
18
18
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
19
19
|
import com.facebook.react.uimanager.ViewManager;
|
|
@@ -22,6 +22,11 @@ import java.util.HashMap;
|
|
|
22
22
|
import java.util.List;
|
|
23
23
|
import java.util.Map;
|
|
24
24
|
|
|
25
|
+
@ReactModuleList(
|
|
26
|
+
nativeModules = {
|
|
27
|
+
ReanimatedModule.class,
|
|
28
|
+
ReanimatedUIManager.class,
|
|
29
|
+
})
|
|
25
30
|
public class ReanimatedPackage extends TurboReactPackage implements ReactPackage {
|
|
26
31
|
|
|
27
32
|
@Override
|
|
@@ -55,7 +60,7 @@ public class ReanimatedPackage extends TurboReactPackage implements ReactPackage
|
|
|
55
60
|
reactModule.needsEagerInit(),
|
|
56
61
|
reactModule.hasConstants(),
|
|
57
62
|
reactModule.isCxxModule(),
|
|
58
|
-
|
|
63
|
+
BuildConfig.IS_NEW_ARCHITECTURE_ENABLED));
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
return new ReactModuleInfoProvider() {
|
|
@@ -2,7 +2,6 @@ package com.swmansion.reanimated;
|
|
|
2
2
|
|
|
3
3
|
import android.os.Build;
|
|
4
4
|
import android.util.Log;
|
|
5
|
-
|
|
6
5
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
7
6
|
import com.facebook.react.uimanager.ReanimatedUIImplementation;
|
|
8
7
|
import com.facebook.react.uimanager.ReanimatedUIManager;
|
|
@@ -10,14 +9,16 @@ import com.facebook.react.uimanager.UIImplementation;
|
|
|
10
9
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
11
10
|
import com.facebook.react.uimanager.ViewManager;
|
|
12
11
|
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
13
|
-
|
|
14
12
|
import java.lang.reflect.Field;
|
|
15
13
|
import java.lang.reflect.Modifier;
|
|
16
14
|
import java.util.List;
|
|
17
15
|
|
|
18
16
|
public class ReanimatedUIManagerFactory {
|
|
19
17
|
|
|
20
|
-
static UIManagerModule create(
|
|
18
|
+
static UIManagerModule create(
|
|
19
|
+
ReactApplicationContext reactContext,
|
|
20
|
+
List<ViewManager> viewManagers,
|
|
21
|
+
int minTimeLeftInFrameForNonBatchedOperationMs) {
|
|
21
22
|
ViewManagerRegistry viewManagerRegistry = new ViewManagerRegistry(viewManagers);
|
|
22
23
|
|
|
23
24
|
UIManagerModule uiManagerModule =
|
|
@@ -59,5 +60,4 @@ public class ReanimatedUIManagerFactory {
|
|
|
59
60
|
|
|
60
61
|
return uiManagerModule;
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
}
|
|
63
|
+
}
|
package/android/src/main/java/com/swmansion/reanimated/layoutReanimation/AnimationsManager.java
CHANGED
|
@@ -14,13 +14,13 @@ import com.facebook.react.bridge.ReactContext;
|
|
|
14
14
|
import com.facebook.react.bridge.ReadableArray;
|
|
15
15
|
import com.facebook.react.bridge.ReadableMap;
|
|
16
16
|
import com.facebook.react.bridge.ReadableNativeArray;
|
|
17
|
+
import com.facebook.react.bridge.UIManager;
|
|
17
18
|
import com.facebook.react.bridge.WritableMap;
|
|
18
19
|
import com.facebook.react.uimanager.IViewManagerWithChildren;
|
|
19
20
|
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
20
21
|
import com.facebook.react.uimanager.PixelUtil;
|
|
21
22
|
import com.facebook.react.uimanager.ReactStylesDiffMap;
|
|
22
23
|
import com.facebook.react.uimanager.RootView;
|
|
23
|
-
import com.facebook.react.uimanager.UIManagerModule;
|
|
24
24
|
import com.facebook.react.uimanager.ViewManager;
|
|
25
25
|
import com.swmansion.reanimated.AndroidUIScheduler;
|
|
26
26
|
import com.swmansion.reanimated.Utils;
|
|
@@ -34,7 +34,7 @@ import javax.annotation.Nullable;
|
|
|
34
34
|
public class AnimationsManager implements ViewHierarchyObserver {
|
|
35
35
|
private WeakReference<AndroidUIScheduler> mWeakAndroidUIScheduler;
|
|
36
36
|
private ReactContext mContext;
|
|
37
|
-
private
|
|
37
|
+
private UIManager mUIManager;
|
|
38
38
|
private NativeMethodsHolder mNativeMethodsHolder;
|
|
39
39
|
|
|
40
40
|
private HashSet<Integer> mEnteringViews = new HashSet<>();
|
|
@@ -60,9 +60,9 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
60
60
|
mWeakAndroidUIScheduler = new WeakReference<>(androidUIScheduler);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
public AnimationsManager(ReactContext context,
|
|
63
|
+
public AnimationsManager(ReactContext context, UIManager uiManager) {
|
|
64
64
|
mContext = context;
|
|
65
|
-
mUIManager =
|
|
65
|
+
mUIManager = uiManager;
|
|
66
66
|
isInvalidated = false;
|
|
67
67
|
mSharedTransitionManager = new SharedTransitionManager(this);
|
|
68
68
|
}
|
|
@@ -714,8 +714,8 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
714
714
|
return new Point(fromPoint.x - toPoint[0], fromPoint.y - toPoint[1]);
|
|
715
715
|
}
|
|
716
716
|
|
|
717
|
-
public void screenDidLayout() {
|
|
718
|
-
mSharedTransitionManager.screenDidLayout();
|
|
717
|
+
public void screenDidLayout(View view) {
|
|
718
|
+
mSharedTransitionManager.screenDidLayout(view);
|
|
719
719
|
}
|
|
720
720
|
|
|
721
721
|
public void viewDidLayout(View view) {
|
|
@@ -726,6 +726,10 @@ public class AnimationsManager implements ViewHierarchyObserver {
|
|
|
726
726
|
mSharedTransitionManager.onViewsRemoval(tagsToDelete);
|
|
727
727
|
}
|
|
728
728
|
|
|
729
|
+
public void notifyAboutScreenWillDisappear() {
|
|
730
|
+
mSharedTransitionManager.onScreenWillDisappear();
|
|
731
|
+
}
|
|
732
|
+
|
|
729
733
|
public void makeSnapshotOfTopScreenViews(ViewGroup stack) {
|
|
730
734
|
mSharedTransitionManager.doSnapshotForTopScreenViews(stack);
|
|
731
735
|
}
|
|
@@ -6,13 +6,16 @@ import android.view.View;
|
|
|
6
6
|
import android.view.ViewGroup;
|
|
7
7
|
import androidx.annotation.Nullable;
|
|
8
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
9
|
+
import com.facebook.react.bridge.ReactContext;
|
|
9
10
|
import com.facebook.react.bridge.UiThreadUtil;
|
|
10
11
|
import com.facebook.react.uimanager.IllegalViewOperationException;
|
|
11
12
|
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
|
13
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
12
14
|
import com.facebook.react.uimanager.ViewAtIndex;
|
|
13
15
|
import com.facebook.react.uimanager.ViewGroupManager;
|
|
14
16
|
import com.facebook.react.uimanager.ViewManager;
|
|
15
17
|
import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
18
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
16
19
|
import com.facebook.react.uimanager.layoutanimation.LayoutAnimationController;
|
|
17
20
|
import com.facebook.react.uimanager.layoutanimation.LayoutAnimationListener;
|
|
18
21
|
import com.swmansion.reanimated.ReanimatedModule;
|
|
@@ -164,6 +167,20 @@ class ReaLayoutAnimator extends LayoutAnimationController {
|
|
|
164
167
|
if (parentName.equals("RNSScreenStack")) {
|
|
165
168
|
mAnimationsManager.cancelAnimationsInSubviews(view);
|
|
166
169
|
super.deleteView(view, listener);
|
|
170
|
+
EventDispatcher eventDispatcher =
|
|
171
|
+
UIManagerHelper.getEventDispatcherForReactTag(
|
|
172
|
+
(ReactContext) view.getContext(), view.getId());
|
|
173
|
+
if (eventDispatcher != null) {
|
|
174
|
+
eventDispatcher.addListener(
|
|
175
|
+
event -> {
|
|
176
|
+
// we schedule the start of transition for the ScreenWilDisappear event, so that the
|
|
177
|
+
// layout of the target screen is already calculated
|
|
178
|
+
// this allows us to make snapshots on the go, so that they are always up-to-date
|
|
179
|
+
if (event.getEventName().equals("topWillDisappear")) {
|
|
180
|
+
getAnimationsManager().notifyAboutScreenWillDisappear();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
167
184
|
return;
|
|
168
185
|
}
|
|
169
186
|
}
|
|
@@ -264,7 +281,7 @@ public class ReanimatedNativeHierarchyManager extends NativeViewHierarchyManager
|
|
|
264
281
|
if (container != null && viewManagerName.equals("RNSScreen") && mReaLayoutAnimator != null) {
|
|
265
282
|
boolean hasHeader = checkIfTopScreenHasHeader((ViewGroup) container);
|
|
266
283
|
if (!hasHeader || !container.isLayoutRequested()) {
|
|
267
|
-
mReaLayoutAnimator.getAnimationsManager().screenDidLayout();
|
|
284
|
+
mReaLayoutAnimator.getAnimationsManager().screenDidLayout(container);
|
|
268
285
|
}
|
|
269
286
|
}
|
|
270
287
|
View view = resolveView(tag);
|