harmony 鸿蒙Animation Overview

  • 2023-06-24
  • 浏览 (631)

Animation Overview

The principle of animation is that the UI appearance is changed for multiple times within a period of time. Because human eyes retain persistence of vision, what you finally see is a continuous animation. A change of the UI is called an animation frame, which corresponds to a screen refresh. An important indicator that determines the animation smoothness is the frame rate (FPS), that is, the number of animation frames per second. The higher the frame rate, the smoother the animation.

In ArkUI, an animation is generated by changing the attribute value and specifying the animation parameters. Animation parameters include animation duration, change rule (that is, curve), and more. After the attribute value changes, the original state is transited to the new state according to the animation parameters. In this way, an animation is formed.

The animation capability provided by ArkUI can be classified into intra-page animation and inter-page animation based on the page classification mode. As shown in the following figure, an animation on a page refers to an animation that can occur on a page, and an animation between pages refers to an animation that occurs only with redirection between pages.

Figure 1 Animation by page

en-us_image_0000001562700385

By capability, the animation can be divided into three parts: attribute animation, explicit animation, and transition animation, as shown in the following figure.

Figure 2 Animation classified by basic capability

en-us_image_0000001562820753

This topic will introduce you to the usage and precautions of animations by the preceding classification and use cases.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙UI Development

harmony 鸿蒙Button

harmony 鸿蒙Custom Dialog Box

harmony 鸿蒙Progress Indicator

harmony 鸿蒙Radio Button

harmony 鸿蒙Toggle

harmony 鸿蒙Text Display

harmony 鸿蒙Text Input

harmony 鸿蒙Video Playback

harmony 鸿蒙XComponent

0  赞