OH_ArkUI_PostIdleCallback

Function OH_ArkUI_PostIdleCallback 

Source
pub unsafe extern "C" fn OH_ArkUI_PostIdleCallback(
    uiContext: ArkUI_ContextHandle,
    userData: *mut c_void,
    callback: Option<unsafe extern "C" fn(nanoTimeLeft: u64, frameCount: u32, userData: *mut c_void)>,
) -> i32
Available on crate features api-12 and api-20 only.
Expand description

Register a callback to be executed at the end of the next idle frame. If there is no next frame, will request one automatically.

§Arguments

  • uiContext - ArkUI_ContextHandle.

  • userData - Indicates the custom data to be saved.

  • callback - Custom callback function.

  • nanoTimeLeft - Time remaining until the end of the current frame.

  • frameCount - Frame count.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_CAPI_INIT_ERROR] if the CAPI init error. Returns [ARKUI_ERROR_CODE_UI_CONTEXT_INVALID] if the uiContext is invalid. Returns [ARKUI_ERROR_CODE_CALLBACK_INVALID] if the callback function is invalid.

Available since API-level: 20