diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1e0b4c4dfee2eca7b881132f18f4a8a34c91c6aa..be3d276e074bb77c614b3c37974c612ae7eea686 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2979,6 +2979,10 @@ "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport" + }, { "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_GetRatios" @@ -2987,6 +2991,10 @@ "first_introduced": "17", "name": "OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval" }, + { + "first_introduced": "21", + "name": "OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport" + }, { "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 d9516d4064cf8985750d97dea981b3953f6b0b3b..f2f8aeced39600b17a2ed483f714b321cf377b73 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1828,6 +1828,23 @@ typedef enum { * Format of the return value {@link ArkUI_AttributeItem}:\n * .value[...].f32: threshold array. \n * + * @since 12 + */ + /** + * @brief Defines the visible area ratio (visible area/total area of the component) threshold for invoking the + * visible area change event of the component, this enum extends the configuration capability. + * + * 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 e43a92fa2e6bb1503111cdb5091bfd59e2e200d6..af24077e924c48f8fdd6ad2d496b18505e59952d 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -5314,6 +5314,31 @@ 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 exceeds will be considered as visible area. +* +* Please note that if the parent component set clip(true), the measureFromViewport configuration +* will be ignored. +* +* @param option Instance of visible area change event parameters. +* @param measureFromViewport When this parameter is set to true, the parts of the component +* that exceed the parent component's area will also be included in the visible area calculation. However, this +* only applies if the parent component does not explicitly set the clip property to true. If the parent component +* sets clip to true, regardless of the value of this parameter, the parts that exceed the parent component's area +* will still be treated as invisible in the visible area calculation. +* Default measureFromViewport: 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_SetMeasureFromViewport( + ArkUI_VisibleAreaEventOptions *option, bool measureFromViewport); + /** * @brief Obtains the threshold ratios for visible area changes. * @@ -5339,6 +5364,16 @@ int32_t OH_ArkUI_VisibleAreaEventOptions_GetRatios(ArkUI_VisibleAreaEventOptions */ int32_t OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval(ArkUI_VisibleAreaEventOptions* option); +/** + * @brief Obtains the value set through {@link OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport} . + * + * @param option Instance of visible area change event parameters. + * @return Returns the flag for controlling of the visible area calculation. Default value: false. + * + * @since 21 + */ +bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEventOptions* option); + /** *@brief Creates a TextPickerRangeContent instance. *