ArkUI_NativeAnimateAPI_1
typedef struct {...} ArkUI_NativeAnimateAPI_1
Overview
Declares the native animation APIs provided by ArkUI.
Since: 12
Related module: ArkUI_NativeModule
Header file: native_animate.h
Summary
Member Functions
| Name | Description |
|---|---|
| int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete) | Defines an explicit animation. |
| int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option) | Defines a keyframe animation. |
| ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option) | Creates an animator object. |
| void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle) | Disposes of an animator object. |
Member Function Description
animateTo()
int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update,ArkUI_AnimateCompleteCallback* complete)
Description
Defines an explicit animation.
Parameters
| Name | Description |
|---|---|
| ArkUI_ContextHandle context | UIContext instance. |
| ArkUI_AnimateOption* option | Defines the animation configuration. |
| ArkUI_ContextCallback* update | Closure function for the animation. The system automatically inserts the transition animation if the state changes in the closure function. Note: Make sure the component attributes to be set in the closure function have been set before. |
| ArkUI_AnimateCompleteCallback* complete | Callback invoked when the animation playback is complete. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
keyframeAnimateTo()
int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option)
Description
Defines a keyframe animation.
Parameters
| Name | Description |
|---|---|
| ArkUI_ContextHandle context | UIContext instance. |
| ArkUI_KeyframeAnimateOption* option | Keyframe animation parameter. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
createAnimator()
ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option)
Description
Creates an animator object.
Parameters
| Name | Description |
|---|---|
| ArkUI_ContextHandle context | UIContext instance. |
| ArkUI_AnimatorOption* option | Animator parameter. |
Returns
| Type | Description |
|---|---|
| ArkUI_AnimatorHandle | Returns the pointer to the animator object; returns NULL if a parameter error occurs. |
disposeAnimator()
void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle)
Description
Disposes of an animator object.
Parameters
| Name | Description |
|---|---|
| ArkUI_AnimatorHandle animatorHandle | Animator object. |