OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent

Function OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent 

Source
pub unsafe extern "C" fn OH_ArkUI_NativeModule_RegisterCommonVisibleAreaApproximateChangeEvent(
    node: ArkUI_NodeHandle,
    ratios: *mut f32,
    size: i32,
    expectedUpdateInterval: f32,
    userData: *mut c_void,
    callback: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>,
) -> i32
Available on crate features api-12 and api-21 only.
Expand description

Register common visible area approximate change event callback of target node.

§Arguments

  • node - The ArkUI-NodeHandle pointer.

  • ratios - Threshold array representing the visible area of the component.

  • size - The size of the ratios.

  • expectedUpdateInterval - The expected calculation interval for developers.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the event callback function.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] Function params is invalid.

Available since API-level: 21