@react-native-ohos/react-native-reanimated 3.18.1-rc.6 → 4.0.0-rc.1
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/compatibility.json +161 -0
- package/harmony/reanimated/BuildProfile.ets +1 -1
- package/harmony/reanimated/build-profile.json5 +8 -1
- package/harmony/reanimated/oh-package.json5 +3 -2
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +31 -40
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.cpp +11 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +3 -4
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.cpp +390 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/InterpolatorRegistry.h +16 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/definitions.h +30 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/filters/FilterOp.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.cpp +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/Quaternion.h +21 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.cpp +166 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.cpp +368 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix2D.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.cpp +594 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformMatrix3D.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.cpp +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/TransformOp.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.cpp +156 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/transforms/vectors.h +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSAngle.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.cpp +48 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSBoolean.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.cpp +135 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSColor.h +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.cpp +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSDiscreteArray.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.cpp +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSKeyword.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.cpp +122 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSLength.h +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.cpp +82 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSNumber.h +63 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValue.h +118 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/CSSValueVariant.h +111 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.cpp +196 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSBoxShadow.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.cpp +134 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/common/values/complex/CSSDropShadow.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.cpp +174 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSAnimationConfig.h +49 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSKeyframesConfig.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.cpp +90 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/CSSTransitionConfig.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.cpp +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/configs/common.h +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.cpp +127 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSAnimation.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.cpp +145 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/core/CSSTransition.h +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.cpp +69 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/EasingFunctions.h +22 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.cpp +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/cubicBezier.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/linear.h +15 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.cpp +13 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/easing/steps.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.cpp +157 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/InterpolatorFactory.h +189 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.cpp +76 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/PropertyInterpolator.h +66 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/configs.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.cpp +136 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperation.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.cpp +38 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterOperationInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.cpp +58 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/FilterStyleInterpolator.h +24 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/blur.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/brightness.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/contrast.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/dropShadow.h +17 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/grayscale.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/hueRotate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/invert.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/opacity.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/saturate.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/filters/operations/sepia.h +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.cpp +95 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/ArrayPropertiesInterpolator.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/GroupPropertiesInterpolator.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.cpp +99 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/groups/RecordPropertiesInterpolator.h +37 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.cpp +308 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/OperationsStyleInterpolator.h +100 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.cpp +19 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperation.h +94 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/operations/StyleOperationInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/AnimationStyleInterpolator.h +26 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.cpp +103 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/styles/TransitionStyleInterpolator.h +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.cpp +224 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperation.h +52 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.cpp +218 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformOperationInterpolator.h +89 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/TransformsStyleInterpolator.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.cpp +208 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/matrix.h +56 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.cpp +42 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/perspective.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/rotate.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.cpp +28 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/scale.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.cpp +14 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/skew.h +20 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.cpp +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/transforms/operations/translate.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.cpp +47 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ResolvableValueInterpolator.h +43 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.cpp +70 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/SimpleValueInterpolator.h +40 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.cpp +146 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/interpolation/values/ValueInterpolator.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.cpp +155 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/misc/ViewStylesRepository.h +53 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.cpp +170 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/AnimationProgressProvider.h +67 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/KeyframeProgressProvider.h +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.cpp +41 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/RawProgressProvider.h +31 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.cpp +193 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/progress/TransitionProgressProvider.h +77 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.cpp +340 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSAnimationsRegistry.h +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.cpp +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSKeyframesRegistry.h +29 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.cpp +167 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/CSSTransitionsRegistry.h +51 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.cpp +61 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/registries/StaticPropsRegistry.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.cpp +80 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGBrush.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.cpp +93 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGLength.h +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.cpp +110 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/svg/values/SVGStrokeDashArray.h +33 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.cpp +75 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/DelayedItemsManager.h +45 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.cpp +12 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/algorithms.h +10 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/interpolators.h +23 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.cpp +149 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/CSS/utils/props.h +32 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +51 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +13 -15
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedCommitShadowNode.h +0 -3
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +22 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +12 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.cpp +46 -37
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/ShadowTreeCloner.h +3 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +72 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.h +25 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.cpp +160 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistry.h +71 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.cpp +161 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/updates/UpdatesRegistryManager.h +65 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationType.h +4 -2
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.cpp +62 -157
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +38 -46
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.cpp +79 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxyCommon.h +81 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.cpp +864 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Experimental.h +214 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/{LayoutAnimationsProxy.cpp → LayoutAnimationsProxy_Legacy.cpp} +303 -276
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy_Legacy.h +220 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.cpp +5 -65
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsUtils.h +52 -82
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.cpp +456 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/PropsDiffer.h +102 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/SharedTransitions.cpp +544 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.cpp +119 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/PropValueProcessor.h +39 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +957 -552
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.h +87 -111
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.cpp +115 -163
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxySpec.h +38 -54
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.cpp +34 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/RNRuntimeDecorator.h +8 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.cpp +46 -58
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/RuntimeDecorators/UIRuntimeDecorator.h +5 -9
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.cpp +18 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeatureFlags.h +44 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/PlatformDepMethodsHolder.h +26 -57
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedSystraceSection.h +12 -33
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/ReanimatedVersion.cpp +46 -0
- package/harmony/reanimated/src/main/cpp/Common/cpp/{worklets → reanimated}/Tools/ReanimatedVersion.h +3 -4
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +60 -85
- package/harmony/reanimated/src/main/cpp/ReanimatedNodesManager.cpp +1 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedPackage.cpp +0 -3
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.cpp +266 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensor.h +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.cpp +36 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedSensorContainer.h +23 -0
- package/harmony/reanimated/src/main/cpp/ReanimatedUIScheduler.h +3 -3
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +12 -1
- package/harmony/reanimated/src/main/ets/ReanimatedPackage.ts +1 -4
- package/harmony/reanimated.har +0 -0
- package/package.json +36 -18
- package/scripts/deploy.js +191 -0
- package/scripts/set-reanimated-version.js +37 -0
- package/scripts/update-version.js +119 -0
- package/scripts/validate-react-native-version.js +46 -0
- package/scripts/validate-worklets-build.js +17 -0
- package/scripts/validate-worklets-version.js +79 -0
- package/scripts/worklets-version.json +4 -0
- package/LICENSE +0 -21
- package/README.OpenSource +0 -11
- package/README.md +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.cpp +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Fabric/PropsRegistry.h +0 -68
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.h +0 -147
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/CollectionUtils.h +0 -14
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.cpp +0 -5
- package/harmony/reanimated/src/main/cpp/Common/cpp/reanimated/Tools/FeaturesConfig.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +0 -59
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.cpp +0 -27
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/NativeModules/WorkletsModuleProxySpec.h +0 -25
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +0 -94
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/EventHandlerRegistry.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +0 -8
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +0 -39
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.cpp +0 -326
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/SharedItems/Shareables.h +0 -345
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.cpp +0 -52
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/AsyncQueue.h +0 -35
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/Defs.h +0 -10
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.cpp +0 -342
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSISerializer.h +0 -47
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSLogger.h +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/JSScheduler.h +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/PlatformLogger.h +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.cpp +0 -26
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedJSIUtils.h +0 -199
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ReanimatedVersion.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/SingleInstanceChecker.h +0 -72
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/ThreadSafeQueue.h +0 -49
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.cpp +0 -20
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/UIScheduler.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +0 -29
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/Tools/WorkletEventHandler.h +0 -41
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +0 -16
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +0 -19
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp +0 -112
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedHermesRuntime.h +0 -127
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.cpp +0 -53
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/ReanimatedRuntime.h +0 -22
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/RuntimeInitialization.md +0 -191
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +0 -155
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +0 -90
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +0 -36
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +0 -182
- package/harmony/reanimated/src/main/cpp/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +0 -22
- package/harmony/reanimated/src/main/cpp/ReanimatedLogger.cpp +0 -33
- package/harmony/reanimated/src/main/cpp/WorkletsModule.cpp +0 -61
- package/harmony/reanimated/src/main/cpp/WorkletsModule.h +0 -22
- package/harmony/reanimated/src/main/cpp/patches/AnimatedSensor/AnimatedSensorModule.cpp +0 -89
- package/harmony/reanimated/src/main/cpp/patches/Fabric/ShadowTreeCloner.cpp +0 -95
- package/harmony/reanimated/src/main/cpp/patches/NativeModules/ReanimatedModuleProxy.cpp +0 -964
- package/harmony/reanimated/src/main/ets/WorkletsModule.ts +0 -15
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#include "ReanimatedSensor.h"
|
|
6
|
+
#include "glog/logging.h"
|
|
7
|
+
#include <sensors/oh_sensor.h>
|
|
8
|
+
#include <window_manager/oh_display_info.h>
|
|
9
|
+
#include <window_manager/oh_display_manager.h>
|
|
10
|
+
namespace rnoh {
|
|
11
|
+
static std::unordered_map<Sensor_Type, ReanimatedSensor *> g_sensorSubscriberMap_;
|
|
12
|
+
static std::mutex g_subscriberMapMutex_; // 保护映射表的互斥锁
|
|
13
|
+
|
|
14
|
+
void SensorDataCallbackImpl(Sensor_Event *event) {
|
|
15
|
+
if (event == nullptr) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
int64_t timestamp = -1;
|
|
19
|
+
// 获取传感器数据的时间戳。
|
|
20
|
+
int32_t ret = OH_SensorEvent_GetTimestamp(event, ×tamp);
|
|
21
|
+
if (ret != SENSOR_SUCCESS) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
Sensor_Type sensorType;
|
|
25
|
+
// 获取传感器类型。
|
|
26
|
+
ret = OH_SensorEvent_GetType(event, &sensorType);
|
|
27
|
+
if (ret != SENSOR_SUCCESS) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
Sensor_Accuracy accuracy = SENSOR_ACCURACY_UNRELIABLE;
|
|
31
|
+
// 获取传感器数据的精度。
|
|
32
|
+
ret = OH_SensorEvent_GetAccuracy(event, &accuracy);
|
|
33
|
+
if (ret != SENSOR_SUCCESS) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
float *data = nullptr;
|
|
37
|
+
uint32_t length = 0;
|
|
38
|
+
// 获取传感器数据。
|
|
39
|
+
ret = OH_SensorEvent_GetData(event, &data, &length);
|
|
40
|
+
if (ret != SENSOR_SUCCESS || data == nullptr) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
|
|
45
|
+
auto it = g_sensorSubscriberMap_.find(sensorType);
|
|
46
|
+
if (it == g_sensorSubscriberMap_.end()) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
ReanimatedSensor *sensorInstance = it->second;
|
|
50
|
+
if (sensorInstance == nullptr) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
switch (sensorType) {
|
|
55
|
+
case SENSOR_TYPE_ACCELEROMETER: {
|
|
56
|
+
double sendData[] = {
|
|
57
|
+
data[0],
|
|
58
|
+
data[1],
|
|
59
|
+
data[2],
|
|
60
|
+
};
|
|
61
|
+
sensorInstance->runSensor(sendData);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
case SENSOR_TYPE_GYROSCOPE: {
|
|
65
|
+
double sendData[] = {
|
|
66
|
+
data[0],
|
|
67
|
+
data[1],
|
|
68
|
+
data[2],
|
|
69
|
+
};
|
|
70
|
+
sensorInstance->runSensor(sendData);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
case SENSOR_TYPE_GRAVITY: {
|
|
74
|
+
double sendData[] = {
|
|
75
|
+
data[0],
|
|
76
|
+
data[1],
|
|
77
|
+
data[2],
|
|
78
|
+
};
|
|
79
|
+
sensorInstance->runSensor(sendData);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
case SENSOR_TYPE_MAGNETIC_FIELD: {
|
|
83
|
+
double sendData[] = {
|
|
84
|
+
data[0],
|
|
85
|
+
data[1],
|
|
86
|
+
data[2],
|
|
87
|
+
};
|
|
88
|
+
sensorInstance->runSensor(sendData);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
case SENSOR_TYPE_ROTATION_VECTOR: {
|
|
92
|
+
double sendData[] = {
|
|
93
|
+
data[0], // x
|
|
94
|
+
data[1], // y
|
|
95
|
+
data[2], // z
|
|
96
|
+
data[3], // w
|
|
97
|
+
// ios
|
|
98
|
+
0, // yaw
|
|
99
|
+
0, // pitch
|
|
100
|
+
0 // roll
|
|
101
|
+
};
|
|
102
|
+
sensorInstance->runSensor(sendData);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
default:
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
rnoh::ReanimatedSensor::ReanimatedSensor(int sensorType, int interval, int iosReferenceFrame,
|
|
112
|
+
std::function<void(double *, int)> setter,
|
|
113
|
+
std::function<void(TaskExecutor::Task &&)> runOnTheMainThread)
|
|
114
|
+
: iosReferenceFrame_(iosReferenceFrame), setter_(std::move(setter)),
|
|
115
|
+
runOnTheMainThread_(std::move(runOnTheMainThread)) {
|
|
116
|
+
if (interval == -1) {
|
|
117
|
+
uint32_t refreshRate = 0;
|
|
118
|
+
OH_NativeDisplayManager_GetDefaultDisplayRefreshRate(&refreshRate);
|
|
119
|
+
if (refreshRate > 0) {
|
|
120
|
+
interval_ = refreshRate * 1000000; // 120hz;
|
|
121
|
+
} else {
|
|
122
|
+
interval_ = 200000000;
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
// js unit is milliseconds
|
|
126
|
+
interval_ = interval * 1000000;
|
|
127
|
+
}
|
|
128
|
+
castSensorType(sensorType);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
void rnoh::ReanimatedSensor::castSensorType(int sensorType) {
|
|
133
|
+
if (sensorType == 1) {
|
|
134
|
+
sensorType_ = SENSOR_TYPE_ACCELEROMETER;
|
|
135
|
+
} else if (sensorType == 2) {
|
|
136
|
+
sensorType_ = SENSOR_TYPE_GYROSCOPE;
|
|
137
|
+
} else if (sensorType == 3) {
|
|
138
|
+
sensorType_ = SENSOR_TYPE_GRAVITY;
|
|
139
|
+
} else if (sensorType == 4) {
|
|
140
|
+
sensorType_ = SENSOR_TYPE_MAGNETIC_FIELD;
|
|
141
|
+
} else if (sensorType == 5) {
|
|
142
|
+
sensorType_ = SENSOR_TYPE_ROTATION_VECTOR;
|
|
143
|
+
} else {
|
|
144
|
+
throw std::invalid_argument("[ReanimatedSensor] Unknown sensorType: " + sensorType);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
bool rnoh::ReanimatedSensor::initialize() {
|
|
149
|
+
if (!isSupportSensor()) {
|
|
150
|
+
LOG(ERROR) << "[ReanimatedSensor] is not support, sensorType:" << sensorType_;
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
id_ = OH_Sensor_CreateSubscriptionId();
|
|
154
|
+
if (id_ == nullptr) {
|
|
155
|
+
LOG(ERROR) << "[ReanimatedSensor] create sensor id failed";
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
int32_t res = OH_SensorSubscriptionId_SetType(id_, sensorType_);
|
|
159
|
+
if (res != SENSOR_SUCCESS) {
|
|
160
|
+
LOG(ERROR) << "[ReanimatedSensor] set sensor type failed ,sensorType:" << sensorType_;
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
auto attr = OH_Sensor_CreateSubscriptionAttribute();
|
|
164
|
+
if (attr == nullptr) {
|
|
165
|
+
LOG(ERROR) << "[ReanimatedSensor] create sensor attribute failed";
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
res = OH_SensorSubscriptionAttribute_SetSamplingInterval(attr, interval_);
|
|
170
|
+
if (res != SENSOR_SUCCESS) {
|
|
171
|
+
LOG(ERROR) << "[ReanimatedSensor] set sensor Interval failed, interval_:" << interval_;
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
subSensor_ = OH_Sensor_CreateSubscriber();
|
|
176
|
+
|
|
177
|
+
{
|
|
178
|
+
std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
|
|
179
|
+
g_sensorSubscriberMap_[sensorType_] = this;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
int32_t ret = OH_SensorSubscriber_SetCallback(subSensor_, SensorDataCallbackImpl);
|
|
183
|
+
if (ret != SENSOR_SUCCESS) {
|
|
184
|
+
LOG(ERROR) << "[ReanimatedSensor] set sensor callback failed";
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
Sensor_Result sensorRes = OH_Sensor_Subscribe(id_, attr, subSensor_);
|
|
188
|
+
if (sensorRes != SENSOR_SUCCESS) {
|
|
189
|
+
LOG(ERROR) << "[ReanimatedSensor] on sensor subscribe failed";
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
bool rnoh::ReanimatedSensor::isSupportSensor() {
|
|
197
|
+
uint32_t count = 0;
|
|
198
|
+
int32_t ret = OH_Sensor_GetInfos(nullptr, &count);
|
|
199
|
+
bool isSupport = false;
|
|
200
|
+
if (count > 0) {
|
|
201
|
+
Sensor_Info **sensors = OH_Sensor_CreateInfos(count);
|
|
202
|
+
ret = OH_Sensor_GetInfos(sensors, &count);
|
|
203
|
+
for (uint32_t i = 0; i < count; ++i) {
|
|
204
|
+
Sensor_Info *sensorInfoTemp = sensors[i];
|
|
205
|
+
Sensor_Type sensorType;
|
|
206
|
+
ret = OH_SensorInfo_GetType(sensorInfoTemp, &sensorType);
|
|
207
|
+
if (sensorType == sensorType_) {
|
|
208
|
+
isSupport = true;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
ret = OH_Sensor_DestroyInfos(sensors, count);
|
|
213
|
+
}
|
|
214
|
+
return isSupport;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
void rnoh::ReanimatedSensor::runSensor(double *value) {
|
|
218
|
+
if (value && setter_ && runOnTheMainThread_) {
|
|
219
|
+
runOnTheMainThread_([weakSelf = weak_from_this(), value]() {
|
|
220
|
+
auto self = weakSelf.lock();
|
|
221
|
+
if (!self) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
self->setter_(value, self->getInterfaceOrientation());
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
int rnoh::ReanimatedSensor::getInterfaceOrientation() {
|
|
230
|
+
NativeDisplayManager_Rotation rotation;
|
|
231
|
+
auto ret = OH_NativeDisplayManager_GetDefaultDisplayRotation(&rotation);
|
|
232
|
+
if (ret == DISPLAY_MANAGER_OK) {
|
|
233
|
+
switch (rotation) {
|
|
234
|
+
case DISPLAY_MANAGER_ROTATION_270:
|
|
235
|
+
return 270;
|
|
236
|
+
case DISPLAY_MANAGER_ROTATION_90:
|
|
237
|
+
return 90;
|
|
238
|
+
case DISPLAY_MANAGER_ROTATION_180:
|
|
239
|
+
return 180;
|
|
240
|
+
default:
|
|
241
|
+
return 0;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
void rnoh::ReanimatedSensor::cancel() { destroySensor(); }
|
|
249
|
+
|
|
250
|
+
void rnoh::ReanimatedSensor::destroySensor() {
|
|
251
|
+
std::lock_guard<std::mutex> lock(g_subscriberMapMutex_);
|
|
252
|
+
for (auto it = g_sensorSubscriberMap_.begin(); it != g_sensorSubscriberMap_.end();) {
|
|
253
|
+
if (it->second == this) {
|
|
254
|
+
OH_Sensor_Unsubscribe(it->second->id_, it->second->subSensor_);
|
|
255
|
+
OH_Sensor_DestroySubscriptionId(it->second->id_);
|
|
256
|
+
OH_Sensor_DestroySubscriber(it->second->subSensor_);
|
|
257
|
+
it->second->subSensor_ = nullptr;
|
|
258
|
+
it = g_sensorSubscriberMap_.erase(it);
|
|
259
|
+
} else {
|
|
260
|
+
++it;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
rnoh::ReanimatedSensor::~ReanimatedSensor() { destroySensor(); }
|
|
266
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#ifndef HARMONY_REANIMATEDSENSOR_H
|
|
6
|
+
#define HARMONY_REANIMATEDSENSOR_H
|
|
7
|
+
#include <functional>
|
|
8
|
+
#include <mutex>
|
|
9
|
+
#include <sensors/oh_sensor_type.h>
|
|
10
|
+
#include "RNOH/TaskExecutor/TaskExecutor.h"
|
|
11
|
+
|
|
12
|
+
namespace rnoh {
|
|
13
|
+
class ReanimatedSensor : public std::enable_shared_from_this<ReanimatedSensor> {
|
|
14
|
+
public:
|
|
15
|
+
ReanimatedSensor(int sensorType, int interval, int iosReferenceFrame, std::function<void(double[], int)> setter,
|
|
16
|
+
std::function<void(TaskExecutor::Task &&)> runOnTheMainThread);
|
|
17
|
+
~ReanimatedSensor();
|
|
18
|
+
bool initialize();
|
|
19
|
+
void cancel();
|
|
20
|
+
void castSensorType(int sensorType);
|
|
21
|
+
void runSensor(double *value);
|
|
22
|
+
std::function<void(double[], int)> setter_;
|
|
23
|
+
Sensor_Type sensorType_{SENSOR_TYPE_ACCELEROMETER};
|
|
24
|
+
|
|
25
|
+
private:
|
|
26
|
+
void destroySensor();
|
|
27
|
+
bool isSupportSensor();
|
|
28
|
+
int getInterfaceOrientation();
|
|
29
|
+
int interval_{-1};
|
|
30
|
+
int iosReferenceFrame_{-1};
|
|
31
|
+
Sensor_Subscriber *subSensor_{nullptr};
|
|
32
|
+
Sensor_SubscriptionId *id_{nullptr};
|
|
33
|
+
std::function<void(TaskExecutor::Task &&)> runOnTheMainThread_;
|
|
34
|
+
};
|
|
35
|
+
} // namespace rnoh
|
|
36
|
+
#endif // HARMONY_REANIMATEDSENSOR_H
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#include "ReanimatedSensorContainer.h"
|
|
6
|
+
#include "glog/logging.h"
|
|
7
|
+
namespace rnoh {
|
|
8
|
+
|
|
9
|
+
rnoh::ReanimatedSensorContainer::ReanimatedSensorContainer() {}
|
|
10
|
+
|
|
11
|
+
int rnoh::ReanimatedSensorContainer::registerSensor(int sensorType, int interval, int iosReferenceFrame,
|
|
12
|
+
std::function<void(double *, int)> setter,
|
|
13
|
+
std::function<void(TaskExecutor::Task &&)> runOnTheMainThread) {
|
|
14
|
+
auto sensor =
|
|
15
|
+
std::make_shared<ReanimatedSensor>(sensorType, interval, iosReferenceFrame, setter, runOnTheMainThread);
|
|
16
|
+
int sensorId = -1;
|
|
17
|
+
if (sensor->initialize()) {
|
|
18
|
+
sensorId = nextSensorId;
|
|
19
|
+
nextSensorId++;
|
|
20
|
+
sensorMap_[sensorId] = sensor;
|
|
21
|
+
}
|
|
22
|
+
return sensorId;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
void rnoh::ReanimatedSensorContainer::unregisterSensor(int sensorId) {
|
|
26
|
+
auto it = sensorMap_.find(sensorId);
|
|
27
|
+
if (it == sensorMap_.end()) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
auto sensor = it->second;
|
|
31
|
+
if (sensor != nullptr) {
|
|
32
|
+
sensor->cancel();
|
|
33
|
+
sensorMap_.erase(it);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
2
|
+
// Use of this source code is governed by a MIT license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
#ifndef HARMONY_REANIMATEDSENSORCONTAINER_H
|
|
6
|
+
#define HARMONY_REANIMATEDSENSORCONTAINER_H
|
|
7
|
+
#include "ReanimatedSensor.h"
|
|
8
|
+
#include <functional>
|
|
9
|
+
namespace rnoh {
|
|
10
|
+
class ReanimatedSensorContainer {
|
|
11
|
+
public:
|
|
12
|
+
ReanimatedSensorContainer();
|
|
13
|
+
~ReanimatedSensorContainer() noexcept = default;
|
|
14
|
+
int registerSensor(int sensorType, int interval, int iosReferenceFrame, std::function<void(double[], int)> setter,
|
|
15
|
+
std::function<void(TaskExecutor::Task &&)> runOnTheMainThread);
|
|
16
|
+
void unregisterSensor(int sensorId);
|
|
17
|
+
|
|
18
|
+
private:
|
|
19
|
+
std::unordered_map<int, std::shared_ptr<ReanimatedSensor>> sensorMap_;
|
|
20
|
+
int nextSensorId{0};
|
|
21
|
+
};
|
|
22
|
+
} // namespace rnoh
|
|
23
|
+
#endif // HARMONY_REANIMATEDSENSORCONTAINER_H
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
6
|
#include <functional>
|
|
7
|
-
|
|
7
|
+
//#include <UIScheduler.h>
|
|
8
8
|
#include <memory>
|
|
9
9
|
#include "RNOH/TaskExecutor/TaskExecutor.h"
|
|
10
10
|
|
|
11
11
|
namespace rnoh {
|
|
12
|
-
class ReanimatedUIScheduler : public std::enable_shared_from_this<ReanimatedUIScheduler
|
|
12
|
+
class ReanimatedUIScheduler : public std::enable_shared_from_this<ReanimatedUIScheduler> { //, public worklets::UIScheduler
|
|
13
13
|
private:
|
|
14
14
|
std::shared_ptr<TaskExecutor> m_taskExecutor;
|
|
15
15
|
|
|
16
16
|
public:
|
|
17
17
|
ReanimatedUIScheduler(std::shared_ptr<TaskExecutor> taskExecutor);
|
|
18
|
-
void scheduleOnUI(std::function<void()> job) override
|
|
18
|
+
void scheduleOnUI(std::function<void()> job) ; //override
|
|
19
19
|
};
|
|
20
20
|
} // namespace rnoh
|
|
@@ -5,18 +5,22 @@
|
|
|
5
5
|
import { RNOHLogger, Tag, UITurboModule, UITurboModuleContext } from "@rnoh/react-native-openharmony/ts";
|
|
6
6
|
import { window } from '@kit.ArkUI';
|
|
7
7
|
import { AnimationManager } from './AnimationManager'
|
|
8
|
+
import settings from '@ohos.settings';
|
|
9
|
+
import { } from "@ohos.display"
|
|
8
10
|
|
|
9
11
|
export class ReanimatedModule extends UITurboModule {
|
|
10
12
|
static NAME = "ReanimatedModule"
|
|
11
13
|
private logger: RNOHLogger
|
|
12
14
|
private keyBordHeight = 0;
|
|
13
15
|
|
|
14
|
-
constructor(ctx:
|
|
16
|
+
constructor(ctx: UITurboModuleContext) {
|
|
15
17
|
super(ctx);
|
|
16
18
|
this.logger = ctx.logger.clone("Reanimated");
|
|
17
19
|
}
|
|
20
|
+
|
|
18
21
|
public setViewProps(tag: Tag, props: Object) {
|
|
19
22
|
this.ctx.descriptorRegistry.setAnimatedRawProps(tag, props);
|
|
23
|
+
|
|
20
24
|
}
|
|
21
25
|
|
|
22
26
|
public async subscribeKeyBordListeners() {
|
|
@@ -38,4 +42,11 @@ export class ReanimatedModule extends UITurboModule {
|
|
|
38
42
|
windowInstance.off('keyboardHeightChange', (v) => {
|
|
39
43
|
})
|
|
40
44
|
}
|
|
45
|
+
|
|
46
|
+
public setGestureHandlerState(handlerTag: Tag, newState: number) {
|
|
47
|
+
const module = this.ctx.rnInstance.getTurboModule("RNGestureHandlerModule") as any;
|
|
48
|
+
if (module && module.setGestureHandlerState) {
|
|
49
|
+
module.setGestureHandlerState(handlerTag, newState);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
41
52
|
}
|
|
@@ -5,20 +5,17 @@
|
|
|
5
5
|
import { RNPackage, UITurboModuleContext, TurboModulesFactory } from "@rnoh/react-native-openharmony/ts";
|
|
6
6
|
import type { UITurboModule } from "@rnoh/react-native-openharmony/ts";
|
|
7
7
|
import { ReanimatedModule } from './ReanimatedModule';
|
|
8
|
-
import { WorkletsModule } from './WorkletsModule';
|
|
9
8
|
|
|
10
9
|
class ReanimatedTurboModulesFactory extends TurboModulesFactory {
|
|
11
10
|
createTurboModule(name: string): UITurboModule | null {
|
|
12
11
|
if (name === ReanimatedModule.NAME) {
|
|
13
12
|
return new ReanimatedModule(this.ctx);
|
|
14
|
-
} else if (name === WorkletsModule.NAME) {
|
|
15
|
-
return new WorkletsModule(this.ctx);
|
|
16
13
|
}
|
|
17
14
|
return null;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
hasTurboModule(name: string): boolean {
|
|
21
|
-
return name === 'ReanimatedModule'
|
|
18
|
+
return name === 'ReanimatedModule';
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
|
package/harmony/reanimated.har
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"alias": "react-native-reanimated",
|
|
5
5
|
"redirectInternalImports": true
|
|
6
6
|
},
|
|
7
|
-
"version": "
|
|
7
|
+
"version": "4.0.0-rc.1",
|
|
8
8
|
"description": "",
|
|
9
9
|
"main": "lib/index.js",
|
|
10
10
|
"scripts": {
|
|
@@ -18,33 +18,51 @@
|
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": "*",
|
|
20
20
|
"react-native": "*",
|
|
21
|
-
"react-native-
|
|
22
|
-
"react-native-reanimated": "3.18.0"
|
|
21
|
+
"react-native-reanimated": "4.2.1"
|
|
23
22
|
},
|
|
24
23
|
"author": "",
|
|
25
24
|
"license": "ISC",
|
|
26
25
|
"dependencies": {
|
|
27
|
-
|
|
28
|
-
"react-native-reanimated": "
|
|
26
|
+
"@types/node": "^24.0.14",
|
|
27
|
+
"react-native-reanimated": "4.2.1"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
|
-
"@babel/
|
|
32
|
-
"@babel/
|
|
33
|
-
"@babel
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"react": "
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
30
|
+
"@babel/core": "7.28.4",
|
|
31
|
+
"@babel/preset-env": "7.28.3",
|
|
32
|
+
"@react-native/babel-preset": "0.82.0",
|
|
33
|
+
"@react-native/eslint-config": "0.82.0",
|
|
34
|
+
"@react-native/metro-config": "0.82.0",
|
|
35
|
+
"@react-native/typescript-config": "0.82.0",
|
|
36
|
+
"@testing-library/jest-native": "5.4.3",
|
|
37
|
+
"@testing-library/react-hooks": "8.0.1",
|
|
38
|
+
"@testing-library/react-native": "13.3.3",
|
|
39
|
+
"@types/convert-source-map": "2.0.3",
|
|
40
|
+
"@types/jest": "30.0.0",
|
|
41
|
+
"@types/node": "24.0.14",
|
|
42
|
+
"@types/react": "19.2.2",
|
|
43
|
+
"@types/react-test-renderer": "19.1.0",
|
|
44
|
+
"@types/semver": "7.7.1",
|
|
45
|
+
"clang-format-node": "1.3.5",
|
|
46
|
+
"eslint": "9.37.0",
|
|
47
|
+
"jest": "30.2.0",
|
|
48
|
+
"knip": "5.61.3",
|
|
49
|
+
"madge": "8.0.0",
|
|
50
|
+
"prettier": "3.6.2",
|
|
51
|
+
"react": "19.1.1",
|
|
52
|
+
"react-dom": "19.1.1",
|
|
53
|
+
"react-native": "0.82.0",
|
|
54
|
+
"react-native-builder-bob": "0.40.13",
|
|
55
|
+
"react-native-web": "0.21.1",
|
|
56
|
+
"react-native-worklets": "0.7.1",
|
|
57
|
+
"react-test-renderer": "19.1.1",
|
|
58
|
+
"typescript": "5.8.3"
|
|
43
59
|
},
|
|
44
60
|
"files": [
|
|
45
61
|
"lib",
|
|
46
62
|
"harmony",
|
|
63
|
+
"scripts",
|
|
47
64
|
"src",
|
|
48
|
-
"./harmony.tar.gz"
|
|
65
|
+
"./harmony.tar.gz",
|
|
66
|
+
"compatibility.json"
|
|
49
67
|
]
|
|
50
68
|
}
|