@react-native-ohos/react-native-reanimated 4.0.2-beta.1 → 4.0.2
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/harmony/reanimated/BuildProfile.ets +1 -1
- package/harmony/reanimated/oh-package.json5 +1 -1
- package/harmony/reanimated/src/main/cpp/CMakeLists.txt +2 -5
- package/harmony/reanimated/src/main/cpp/ReanimatedModule.cpp +14 -1
- package/harmony/reanimated/src/main/ets/ReanimatedModule.ts +13 -2
- package/harmony/reanimated.har +0 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
3
3
|
*/
|
|
4
|
-
export const HAR_VERSION = '4.0.2
|
|
4
|
+
export const HAR_VERSION = '4.0.2';
|
|
5
5
|
export const BUILD_MODE_NAME = 'debug';
|
|
6
6
|
export const DEBUG = true;
|
|
7
7
|
export const TARGET_NAME = 'default';
|
|
@@ -6,11 +6,8 @@ add_compile_definitions(REANIMATED_VERSION=4.2.1)
|
|
|
6
6
|
#add_compile_definitions(JS_RUNTIME_HERMES=1)
|
|
7
7
|
add_compile_definitions(RCT_NEW_ARCH_ENABLED=1)
|
|
8
8
|
add_compile_definitions(REACT_NATIVE_MINOR_VERSION=82)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
else()
|
|
12
|
-
add_compile_definitions(HERMES_ENABLE_DEBUGGER=0)
|
|
13
|
-
endif()
|
|
9
|
+
add_compile_definitions(HERMES_ENABLE_DEBUGGER=0)
|
|
10
|
+
|
|
14
11
|
set(REANIMATED_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Common")
|
|
15
12
|
|
|
16
13
|
file(GLOB rnoh_reanimated_SRC CONFIGURE_DEPENDS *.cpp)
|
|
@@ -162,7 +162,20 @@ void ReanimatedModule::installTurboModule(facebook::jsi::Runtime &rt) {
|
|
|
162
162
|
unsubscribeFromKeyboardEventsFunction,
|
|
163
163
|
maybeFlushUIUpdatesQueueFunction,
|
|
164
164
|
};
|
|
165
|
-
|
|
165
|
+
bool isReducedMotion = false; // ANIMATOR_DURATION_SCALE
|
|
166
|
+
m_ctx.taskExecutor->runSyncTask(TaskThread::MAIN,
|
|
167
|
+
[ctx = m_ctx, &isReducedMotion]() {
|
|
168
|
+
if (!ctx.arkTSTurboModuleInstanceRef) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
ArkJS arkJs(ctx.env);
|
|
172
|
+
auto napiTurboModuleObject =
|
|
173
|
+
arkJs.getObject(ctx.arkTSTurboModuleInstanceRef);
|
|
174
|
+
auto napiResult =
|
|
175
|
+
napiTurboModuleObject.call("isReducedMotionEnabled", {});
|
|
176
|
+
isReducedMotion = arkJs.getBoolean(napiResult);
|
|
177
|
+
});
|
|
178
|
+
|
|
166
179
|
auto workletsModule = [weakSelf = weak_from_this()]() -> std::shared_ptr<WorkletsModule> {
|
|
167
180
|
auto self = weakSelf.lock();
|
|
168
181
|
if (!self) {
|
|
@@ -5,8 +5,8 @@
|
|
|
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
|
|
9
|
-
import { } from
|
|
8
|
+
import deviceInfo from '@ohos.deviceInfo';
|
|
9
|
+
import { accessibility } from '@kit.AccessibilityKit';
|
|
10
10
|
|
|
11
11
|
export class ReanimatedModule extends UITurboModule {
|
|
12
12
|
static NAME = "ReanimatedModule"
|
|
@@ -49,4 +49,15 @@ export class ReanimatedModule extends UITurboModule {
|
|
|
49
49
|
module.setGestureHandlerState(handlerTag, newState);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
public isReducedMotionEnabled(): boolean {
|
|
54
|
+
try {
|
|
55
|
+
if (deviceInfo.sdkApiVersion >= 23) {
|
|
56
|
+
return (accessibility as ESObject).isAnimationReduceEnabledSync();
|
|
57
|
+
}
|
|
58
|
+
} catch (e) {
|
|
59
|
+
this.logger.warn(`isReducedMotionEnabled failed: ${JSON.stringify(e)}`);
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
52
63
|
}
|
package/harmony/reanimated.har
CHANGED
|
Binary file
|