From de07eb2db66f5c1be65d44ff974d0e7e74b6b29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=B8=85=E4=BA=91?= Date: Wed, 13 Aug 2025 15:34:49 +0800 Subject: [PATCH] =?UTF-8?q?onVisibleAreaChange:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E5=8C=BA=E5=9F=9F=E8=B6=85=E5=87=BA=E7=88=B6?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=BE=B9=E7=95=8C=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡清云 --- arkui/ace_engine/native/libace.ndk.json | 8 +++++++ arkui/ace_engine/native/native_node.h | 16 ++++++++++++++ arkui/ace_engine/native/native_type.h | 28 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 3c739a283d0..0028e652218 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2975,6 +2975,10 @@ "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_VisibleAreaEventOptions_SetOutOfBoundsAllowed" + }, { "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_GetRatios" @@ -2983,6 +2987,10 @@ "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_VisibleAreaEventOptions_GetOutOfBoundsAllowed" + }, { "first_introduced": "17", "name": "OH_ArkUI_UIInputEvent_GetEventTargetWidth" diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 624843e754a..a70c0ba3acd 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1801,6 +1801,22 @@ typedef enum { * .value[...].f32: threshold array. \n * */ + /** + * @brief Defines the visible area ratio (visible area/total area of the component) threshold for invoking the + * visible area change event of the component. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[...].f32: threshold array. The value range is 0 to 1. + * .?object: pass in one {@link ArkUI_VisibleAreaEventOptions} object for configuring the ratio or other options. + * Please note, when use this param, the ratios set through .value[...].f32 will be ignored, and the update + * interval from it is always ignored too. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[...].f32: threshold array. \n + * .object: the {@link ArkUI_VisibleAreaEventOptions} object. + * + * @since 21 + */ NODE_VISIBLE_AREA_CHANGE_RATIO = 93, /** diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 3bfa0c36dc2..2dec47a499c 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -5202,6 +5202,24 @@ int32_t OH_ArkUI_VisibleAreaEventOptions_SetRatios(ArkUI_VisibleAreaEventOptions int32_t OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval( ArkUI_VisibleAreaEventOptions *option, int32_t value); +/** +* @brief Sets the flag for controlling if the child components can exceed the parent's bounds. +* if set to false, the part that exceeds the parent's bounds will be considered as invisible area, +* set to true to allow the exceeding, the part that that exceeds will be considered as visible area. +* +* @param option Instance of visible area change event parameters. +* @param isOutOfBoundsAllowed if allows the child components exceeds the parent's bounds. +* Default isOutOfBoundsAllowed: false +* @return Returns the result code. +* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. +* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. +* If an error code is returned, it may be due to a failure in parameter validation; +* the parameter must not be null. +* @since 21 +*/ +int32_t OH_ArkUI_VisibleAreaEventOptions_SetOutOfBoundsAllowed( + ArkUI_VisibleAreaEventOptions *option, bool isOutOfBoundsAllowed); + /** * @brief Obtains the threshold ratios for visible area changes. * @@ -5227,6 +5245,16 @@ int32_t OH_ArkUI_VisibleAreaEventOptions_GetRatios(ArkUI_VisibleAreaEventOptions */ int32_t OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval(ArkUI_VisibleAreaEventOptions* option); +/** + * @brief Obtains the flag for controlling if the child components can exceed the parent's bounds. + * + * @param option Instance of visible area change event parameters. + * @return Returns the flag for controlling if the child components can exceed the parent's bounds. + * Default value: false. + * @since 21 + */ +bool OH_ArkUI_VisibleAreaEventOptions_GetOutOfBoundsAllowed(ArkUI_VisibleAreaEventOptions* option); + /** *@brief Creates a TextPickerRangeContent instance. * -- Gitee