From fb4490135882001a13cf90c9b9f25fed2998f68b Mon Sep 17 00:00:00 2001 From: lisitao Date: Fri, 28 Jun 2024 04:12:15 +0000 Subject: [PATCH] [NDK] fix anmate api Signed-off-by:lisitaolisitao3@huawei.com Signed-off-by: lisitao Change-Id: I842ca898b11580e19244d667edb0a9506ac2a34b --- interfaces/native/libace.ndk.json | 18 +++++++++--------- interfaces/native/native_animate.h | 20 +++++++++++--------- interfaces/native/node/node_animate.cpp | 19 ++++++++++--------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/interfaces/native/libace.ndk.json b/interfaces/native/libace.ndk.json index 65c21fc1606..516bab4e48e 100644 --- a/interfaces/native/libace.ndk.json +++ b/interfaces/native/libace.ndk.json @@ -1597,39 +1597,39 @@ }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_InitCurve" + "name": "OH_ArkUI_Curve_CreateCurveByType" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_StepsCurve" + "name": "OH_ArkUI_Curve_CreateStepsCurve" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_CubicBezierCurve" + "name": "OH_ArkUI_Curve_CreateCubicBezierCurve" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_SpringCurve" + "name": "OH_ArkUI_Curve_CreateSpringCurve" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_SpringMotion" + "name": "OH_ArkUI_Curve_CreateSpringMotion" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_ResponsiveSpringMotion" + "name": "OH_ArkUI_Curve_CreateResponsiveSpringMotion" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_InterpolatingSpring" + "name": "OH_ArkUI_Curve_CreateInterpolatingSpring" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_CustomCurve" + "name": "OH_ArkUI_Curve_CreateCustomCurve" }, { "first_introduced": "12", - "name": "OH_ArkUI_Curve_disposeCurve" + "name": "OH_ArkUI_Curve_DisposeCurve" }, { "first_introduced": "12", diff --git a/interfaces/native/native_animate.h b/interfaces/native/native_animate.h index cef16df8347..15566588150 100644 --- a/interfaces/native/native_animate.h +++ b/interfaces/native/native_animate.h @@ -298,15 +298,17 @@ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animator); int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animator); int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animator); int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animator); -ArkUI_CurveHandle OH_ArkUI_Curve_InitCurve(ArkUI_AnimationCurve curve); -ArkUI_CurveHandle OH_ArkUI_Curve_StepsCurve(int32_t count, bool end); -ArkUI_CurveHandle OH_ArkUI_Curve_CubicBezierCurve(float x1, float y1, float x2, float y2); -ArkUI_CurveHandle OH_ArkUI_Curve_SpringCurve(float velocity, float mass, float stiffness, float damping); -ArkUI_CurveHandle OH_ArkUI_Curve_SpringMotion(float response, float dampingFraction, float overlapDuration); -ArkUI_CurveHandle OH_ArkUI_Curve_ResponsiveSpringMotion(float response, float dampingFraction, float overlapDuration); -ArkUI_CurveHandle OH_ArkUI_Curve_InterpolatingSpring(float velocity, float mass, float stiffness, float damping); -ArkUI_CurveHandle OH_ArkUI_Curve_CustomCurve(void* userData, float (*interpolate)(float fraction, void* userdata)); -void OH_ArkUI_Curve_disposeCurve(ArkUI_CurveHandle curveHandle); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( + float response, float dampingFraction, float overlapDuration); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( + void* userData, float (*interpolate)(float fraction, void* userdata)); +void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); #ifdef __cplusplus }; #endif diff --git a/interfaces/native/node/node_animate.cpp b/interfaces/native/node/node_animate.cpp index 18fd206cca3..8193db2f206 100644 --- a/interfaces/native/node/node_animate.cpp +++ b/interfaces/native/node/node_animate.cpp @@ -646,47 +646,48 @@ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animator) return OHOS::Ace::AnimateModel::AnimatorReverse(animator); } -ArkUI_CurveHandle OH_ArkUI_Curve_InitCurve(ArkUI_AnimationCurve curve) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve) { return OHOS::Ace::AnimateModel::InitCurve(curve); } -ArkUI_CurveHandle OH_ArkUI_Curve_StepsCurve(int32_t count, bool end) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end) { return OHOS::Ace::AnimateModel::StepsCurve(count, end); } -ArkUI_CurveHandle OH_ArkUI_Curve_CubicBezierCurve(float x1, float y1, float x2, float y2) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2) { return OHOS::Ace::AnimateModel::CubicBezierCurve(x1, y1, x2, y2); } -ArkUI_CurveHandle OH_ArkUI_Curve_SpringCurve(float velocity, float mass, float stiffness, float damping) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping) { return OHOS::Ace::AnimateModel::SpringCurve(velocity, mass, stiffness, damping); } -ArkUI_CurveHandle OH_ArkUI_Curve_SpringMotion(float response, float dampingFraction, float overlapDuration) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration) { return OHOS::Ace::AnimateModel::SpringMotion(response, dampingFraction, overlapDuration); } -ArkUI_CurveHandle OH_ArkUI_Curve_ResponsiveSpringMotion(float response, float dampingFraction, float overlapDuration) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( + float response, float dampingFraction, float overlapDuration) { return OHOS::Ace::AnimateModel::ResponsiveSpringMotion(response, dampingFraction, overlapDuration); } -ArkUI_CurveHandle OH_ArkUI_Curve_InterpolatingSpring(float velocity, float mass, float stiffness, float damping) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping) { return OHOS::Ace::AnimateModel::InterpolatingSpring(velocity, mass, stiffness, damping); } -ArkUI_CurveHandle OH_ArkUI_Curve_CustomCurve(void* userData, float (*interpolate)(float fraction, void* userdata)) +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve(void* userData, float (*interpolate)(float fraction, void* userdata)) { return OHOS::Ace::AnimateModel::CustomCurve(userData, interpolate); } -void OH_ArkUI_Curve_disposeCurve(ArkUI_CurveHandle curveHandle) +void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle) { return OHOS::Ace::AnimateModel::DisposeCurve(curveHandle); }