From 87a096835eec7c9237f64a7bb0d6cf27e0441d4d Mon Sep 17 00:00:00 2001 From: fangzhiyuan Date: Sat, 30 Aug 2025 18:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4areachange=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangzhiyuan --- arkui/ace_engine/native/libace.ndk.json | 8 +++++++ arkui/ace_engine/native/native_node.h | 28 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index dc359a75005..d7a4753891a 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4075,6 +4075,14 @@ "first_introduced": "21", "name": "OH_ArkUI_NativeModule_UnregisterCommonEvent" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent" + }, + { + "first_introduced": "21", + "name": "OH_ArkUI_NativeModule_UnregisterCommonVisibleAreaApproximateChangeEvent" + }, { "first_introduced": "21", "name": "OH_ArkUI_PositionEdges_Create" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index ff2f5bb5462..5cd2e0fc1e8 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -10269,6 +10269,34 @@ int32_t OH_ArkUI_NativeModule_RegisterCommonEvent(ArkUI_NodeHandle node, ArkUI_N */ int32_t OH_ArkUI_NativeModule_UnregisterCommonEvent(ArkUI_NodeHandle node, ArkUI_NodeEventType eventType); +/** + * @brief Register common visible area approximate change event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @param ratios Threshold array representing the visible area of the component. + * @param size The size of the ratios. + * @param expectedUpdateInterval The expected calculation interval for developers. + * @param userData Indicates the pointer to the custom data. + * @param callback Indicates the event callback function. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent(ArkUI_NodeHandle node, float* ratios, + int32_t size, float expectedUpdateInterval, void* userData, void (*callback)(ArkUI_NodeEvent* event)); + +/** + * @brief Unregister common visible area approximate change event callback of target node. + * + * @param node The ArkUI-NodeHandle pointer. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} Function params is invalid. + * @since 21 + */ +int32_t OH_ArkUI_NativeModule_UnregisterCommonVisibleAreaApproximateChangeEvent(ArkUI_NodeHandle node); + #ifdef __cplusplus }; #endif -- Gitee