harmony 鸿蒙native_animate.h

  • 2025-06-12
  • 浏览 (4)

native_animate.h

Overview

Defines a set of animation APIs of ArkUI on the native side.

Library: libace_ndk.z.so

File to include:

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_NativeModule

Summary

Structs

Name Description
struct  ArkUI_ExpectedFrameRateRange Defines a struct for the expected frame rate range of the animation.
struct  ArkUI_AnimateCompleteCallback Defines a struct for the callback type for when the animation playback is complete.
struct  ArkUI_NativeAnimateAPI_1 Defines a struct for the animation APIs of ArkUI on the native side.

Types

Name Description
typedef struct ArkUI_AnimateOption ArkUI_AnimateOption Defines a struct for the animation configuration.
typedef struct ArkUI_Curve * ArkUI_CurveHandle Defines a struct for the pointer to an interpolation curve.
typedef struct ArkUI_KeyframeAnimateOption ArkUI_KeyframeAnimateOption Defines the keyframe animation parameter object.
typedef struct ArkUI_AnimatorOption ArkUI_AnimatorOption Defines the animator parameter object.
typedef struct ArkUI_Animator * ArkUI_AnimatorHandle Defines the pointer to an animator object.
typedef struct ArkUI_TransitionEffect ArkUI_TransitionEffect Defines the transition effect.

Callback

Name Description
ArkUI_AnimateOption * OH_ArkUI_AnimateOption_Create () Creates an animation configuration.
void OH_ArkUI_AnimateOption_Dispose (ArkUI_AnimateOption *option) Disposes of an animation configuration.
int32_t OH_ArkUI_AnimateOption_GetDuration (ArkUI_AnimateOption *option) Obtains the animation duration, in milliseconds.
float OH_ArkUI_AnimateOption_GetTempo (ArkUI_AnimateOption *option) Obtains the playback speed of an animation.
ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve (ArkUI_AnimateOption *option) Obtains an animation curve.
int32_t OH_ArkUI_AnimateOption_GetDelay (ArkUI_AnimateOption *option) Obtains the animation delay, in milliseconds.
int32_t OH_ArkUI_AnimateOption_GetIterations (ArkUI_AnimateOption *option) Obtains the number of times that an animation is played.
ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode (ArkUI_AnimateOption *option) Obtains the playback mode of an animation.
ArkUI_ExpectedFrameRateRange * OH_ArkUI_AnimateOption_GetExpectedFrameRateRange (ArkUI_AnimateOption *option) Obtains the expected frame rate range of an animation.
void OH_ArkUI_AnimateOption_SetDuration (ArkUI_AnimateOption *option, int32_t value) Sets the animation duration.
void OH_ArkUI_AnimateOption_SetTempo (ArkUI_AnimateOption *option, float value) Sets the playback speed of an animation.
void OH_ArkUI_AnimateOption_SetCurve (ArkUI_AnimateOption *option, ArkUI_AnimationCurve value) Animation curve.
void OH_ArkUI_AnimateOption_SetDelay (ArkUI_AnimateOption *option, int32_t value) Sets the animation delay.
void OH_ArkUI_AnimateOption_SetIterations (ArkUI_AnimateOption *option, int32_t value) Sets the number of times that an animation is played.
void OH_ArkUI_AnimateOption_SetPlayMode (ArkUI_AnimateOption *option, ArkUI_AnimationPlayMode value) Sets the playback mode for an animation.
void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange (ArkUI_AnimateOption *option, ArkUI_ExpectedFrameRateRange *value) Defines a struct for the expected frame rate range of the animation.
void OH_ArkUI_AnimateOption_SetICurve (ArkUI_AnimateOption *option, ArkUI_CurveHandle value) Sets the animation curve for an animation.
ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve (ArkUI_AnimateOption *option) Obtains the animation curve of an animation.
ArkUI_KeyframeAnimateOption * OH_ArkUI_KeyframeAnimateOption_Create (int32_t size) Obtains the keyframe animation parameters.
void OH_ArkUI_KeyframeAnimateOption_Dispose (ArkUI_KeyframeAnimateOption *option) Disposes of a keyframe animation parameter object.
int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay (ArkUI_KeyframeAnimateOption *option, int32_t value) Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation is played without delay.
int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations (ArkUI_KeyframeAnimateOption *option, int32_t value) Sets the number of times that the keyframe animation is played. By default, the animation is played once. The value -1 indicates that the animation is played for an unlimited number of times. The value 0 indicates that there is no animation.
int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback (ArkUI_KeyframeAnimateOption *option, void *userData, void(*onFinish)(void *userData)) Sets the callback invoked when the keyframe animation playback is complete. This API is called after the keyframe animation has played for the specified number of times.
int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration (ArkUI_KeyframeAnimateOption *option, int32_t value, int32_t index) Sets the duration of a keyframe animation, in milliseconds.
int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve (ArkUI_KeyframeAnimateOption *option, ArkUI_CurveHandle value, int32_t index) Sets the animation curve for a specific keyframe in a keyframe animation.
int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback (ArkUI_KeyframeAnimateOption *option, void *userData, void(*event)(void *userData), int32_t index) Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the time of the keyframe.
int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay (ArkUI_KeyframeAnimateOption *option) Obtains the overall delay of a keyframe animation
int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations (ArkUI_KeyframeAnimateOption *option) Obtains the number of times that a keyframe animation is played.
int32_t OH_ArkUI_KeyframeAnimateOption_GetDuration (ArkUI_KeyframeAnimateOption *option, int32_t index) Obtains the duration of a specific state in a keyframe animation.
ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve (ArkUI_KeyframeAnimateOption *option, int32_t index) Obtains the animation curve of a specific state in a keyframe animation.
ArkUI_AnimatorOption * OH_ArkUI_AnimatorOption_Create (int32_t keyframeSize) Creates an AnimatorOption object.
void OH_ArkUI_AnimatorOption_Dispose (ArkUI_AnimatorOption *option) Disposes of an AnimatorOption object.
int32_t OH_ArkUI_AnimatorOption_SetDuration (ArkUI_AnimatorOption *option, int32_t value) Sets the duration of an animation, in milliseconds.
int32_t OH_ArkUI_AnimatorOption_SetDelay (ArkUI_AnimatorOption *option, int32_t value) Sets the delay of animation playback, in milliseconds.
int32_t OH_ArkUI_AnimatorOption_SetIterations (ArkUI_AnimatorOption *option, int32_t value) Sets the number of times that an animation is played. The value 0 means not to play the animation, and -1 means to play the animation for an unlimited number of times.
int32_t OH_ArkUI_AnimatorOption_SetFill (ArkUI_AnimatorOption *option, ArkUI_AnimationFill value) Sets whether the animator animation is restored to the initial state after being executed.
int32_t OH_ArkUI_AnimatorOption_SetDirection (ArkUI_AnimatorOption *option, ArkUI_AnimationDirection value) Set the playback direction.
int32_t OH_ArkUI_AnimatorOption_SetCurve (ArkUI_AnimatorOption *option, ArkUI_CurveHandle value) Sets the interpolation curve for the animation of an animator.
int32_t OH_ArkUI_AnimatorOption_SetBegin (ArkUI_AnimatorOption *option, float value) Sets the interpolation start point of an animation.
int32_t OH_ArkUI_AnimatorOption_SetEnd (ArkUI_AnimatorOption *option, float value) Sets the interpolation end point for the animation of an animator.
int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange (ArkUI_AnimatorOption *option, ArkUI_ExpectedFrameRateRange *value) Sets the expected frame rate range of an animation.
int32_t OH_ArkUI_AnimatorOption_SetKeyframe (ArkUI_AnimatorOption *option, float time, float value, int32_t index) Sets the keyframe parameters of an animation.
int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve (ArkUI_AnimatorOption *option, ArkUI_CurveHandle value, int32_t index) Sets the keyframe curve type for the animation of an animator.
int32_t OH_ArkUI_AnimatorOption_GetDuration (ArkUI_AnimatorOption *option) Obtains the duration for playing an animation.
int32_t OH_ArkUI_AnimatorOption_GetDelay (ArkUI_AnimatorOption *option) Obtains the delay for playing an animation.
int32_t OH_ArkUI_AnimatorOption_GetIterations (ArkUI_AnimatorOption *option) Obtains the number of times that an animation is played.
ArkUI_AnimationFill OH_ArkUI_AnimatorOption_GetFill (ArkUI_AnimatorOption *option) Obtains whether the animator animation is restored to the initial state after being executed.
ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection (ArkUI_AnimatorOption *option) Obtains the playback direction of an animation.
ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve (ArkUI_AnimatorOption *option) Obtains the interpolation curve of the animation of an animator.
float OH_ArkUI_AnimatorOption_GetBegin (ArkUI_AnimatorOption *option) Obtains the interpolation start point of an animation.
float OH_ArkUI_AnimatorOption_GetEnd (ArkUI_AnimatorOption *option) Obtains the interpolation end point of an animation.
ArkUI_ExpectedFrameRateRange * OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange (ArkUI_AnimatorOption *option) Obtains the expected frame rate range of an animation.
float OH_ArkUI_AnimatorOption_GetKeyframeTime (ArkUI_AnimatorOption *option, int32_t index) Obtains the keyframe time of an animation.
float OH_ArkUI_AnimatorOption_GetKeyframeValue (ArkUI_AnimatorOption *option, int32_t index) Obtains the keyframe value of an animation.
ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve (ArkUI_AnimatorOption *option, int32_t index) Obtains the interpolation curve for a keyframe in the animation of an animator.
void * OH_ArkUI_AnimatorEvent_GetUserData (ArkUI_AnimatorEvent *event) Obtains the custom object in an animation event object.
void * OH_ArkUI_AnimatorOnFrameEvent_GetUserData (ArkUI_AnimatorOnFrameEvent *event) Obtains the custom object in an animation event object.
float OH_ArkUI_AnimatorOnFrameEvent_GetValue (ArkUI_AnimatorOnFrameEvent *event) Obtains the current progress in an animation event object.
int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback (ArkUI_AnimatorOption *option, void *userData, void(*callback)(ArkUI_AnimatorOnFrameEvent *event)) Sets the callback invoked when the animator receives a frame.
int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback (ArkUI_AnimatorOption *option, void *userData, void(*callback)(ArkUI_AnimatorEvent *event)) Sets the callback invoked when the animation playback is complete.
int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback (ArkUI_AnimatorOption *option, void *userData, void(*callback)(ArkUI_AnimatorEvent *event)) Sets the callback invoked when the animation playback is canceled.
int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback (ArkUI_AnimatorOption *option, void *userData, void(*callback)(ArkUI_AnimatorEvent *event)) Sets the callback invoked when the animation playback is repeated.
int32_t OH_ArkUI_Animator_ResetAnimatorOption (ArkUI_AnimatorHandle animator, ArkUI_AnimatorOption *option) Resets an animator configuration.
int32_t OH_ArkUI_Animator_Play (ArkUI_AnimatorHandle animator) Starts the animation of an animator.
int32_t OH_ArkUI_Animator_Finish (ArkUI_AnimatorHandle animator) Ends the animation of an animator.
int32_t OH_ArkUI_Animator_Pause (ArkUI_AnimatorHandle animator) Pauses the animation of an animator.
int32_t OH_ArkUI_Animator_Cancel (ArkUI_AnimatorHandle animator) Cancels the animation of an animator.
int32_t OH_ArkUI_Animator_Reverse (ArkUI_AnimatorHandle animator) Plays this animation in reverse order.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType (ArkUI_AnimationCurve curve) Implements initialization for the interpolation curve, which is used to create an interpolation curve based on the input parameter.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve (int32_t count, bool end) Creates a step curve.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve (float x1, float y1, float x2, float y2) Creates a cubic Bezier curve.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve (float velocity, float mass, float stiffness, float damping) Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration is subject to the duration parameter in animation and animateTo.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion (float response, float dampingFraction, float overlapDuration) Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an object, each animation replaces their predecessor and inherits the velocity.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion (float response, float dampingFraction, float overlapDuration) Creates a responsive spring animation curve. It is a special case of springMotion, with the only difference in the default values. It can be used together with springMotion.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring (float velocity, float mass, float stiffness, float damping) Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on the curve.
ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve (void *userData, float(*interpolate)(float fraction, void *userdata)) Creates a custom curve.
void OH_ArkUI_Curve_DisposeCurve (ArkUI_CurveHandle curveHandle) Disposes of a custom curve.
ArkUI_TransitionEffect * OH_ArkUI_CreateOpacityTransitionEffect (float opacity) Creates an opacity object for component transition.
ArkUI_TransitionEffect * OH_ArkUI_CreateTranslationTransitionEffect (ArkUI_TranslationOptions *translate) Creates a translation object for component transition.
ArkUI_TransitionEffect * OH_ArkUI_CreateScaleTransitionEffect (ArkUI_ScaleOptions *scale) Creates a scaling object for component transition.
ArkUI_TransitionEffect * OH_ArkUI_CreateRotationTransitionEffect (ArkUI_RotationOptions *rotate) Creates a rotation object for component transition.
ArkUI_TransitionEffect * OH_ArkUI_CreateMovementTransitionEffect (ArkUI_TransitionEdge move) Creates a movement object for component transition.
ArkUI_TransitionEffect * OH_ArkUI_CreateAsymmetricTransitionEffect (ArkUI_TransitionEffect *appear, ArkUI_TransitionEffect *disappear) Creates an asymmetric transition effect.
void OH_ArkUI_TransitionEffect_Dispose (ArkUI_TransitionEffect *option) Disposes of a transition effect.
int32_t OH_ArkUI_TransitionEffect_Combine (ArkUI_TransitionEffect *option, ArkUI_TransitionEffect *combine) Sets a combination of transition effects.
int32_t OH_ArkUI_TransitionEffect_SetAnimation (ArkUI_TransitionEffect *option, ArkUI_AnimateOption *animation) Sets transition effect animation settings.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

0  赞