From df0b34756a6916bd9b1ce65ae11fd2fcf9d57567 Mon Sep 17 00:00:00 2001 From: hehongyang9 Date: Mon, 2 Dec 2024 20:09:52 +0800 Subject: [PATCH] add expectedFrameRateRange in keyframeAnimateTo Signed-off-by: hehongyang9 Change-Id: I49f5d5d65a2d18630a8b58849582cf79afd9d212 --- arkui/ace_engine/native/libace.ndk.json | 8 ++++++++ arkui/ace_engine/native/native_animate.h | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 1d822febf..09a613d02 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -2470,5 +2470,13 @@ { "first_introduced": "14", "name": "OH_ArkUI_KeyEvent_SetConsumed" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate" + }, + { + "first_introduced": "16", + "name": "OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index bd5c9303e..77831c480 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -413,6 +413,19 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*onFinish)(void* userData)); +/** + * @brief Sets the expected frame rate range of a keyframe animation. + * + * @param option Indicates the pointer to a keyframe animation configuration. + * @param frameRate Indicates the expected frame rate range. + * @return Returns the error 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. + * @since 16 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( + ArkUI_KeyframeAnimateOption* option, ArkUI_ExpectedFrameRateRange* frameRate); + /** * @brief Sets the duration of a keyframe animation, in milliseconds. * @@ -476,6 +489,15 @@ int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* opt */ int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option); +/** + * @brief Obtains the expected frame rate range of a keyframe animation configuration. + * + * @param option Indicates the pointer to a keyframe animation configuration. + * @return Returns the expected frame rate range of the keyframe animation. + * @since 16 + */ +ArkUI_ExpectedFrameRateRange* OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(ArkUI_KeyframeAnimateOption* option); + /** * @brief Obtains the duration of a specific state in a keyframe animation. * -- Gitee