An Introduction to Android Animation Learning

Android animation - first acquaintance

In the Android development process, animation (Animation) accounts for a great proportion. The addition of animation effects can make our application more friendly and beautiful. We know that Android applications can achieve extremely delicate and complex animation effects, so how are these animation effects made? Android FrameWork provides a large number of APIs to support the realization of complex and changeable animation effects. If the animation in Android is classified, it can be roughly divided into View Animation and Property Animation, among which View Animation is further divided into Tween Animation and Frame Animation. Therefore, when we talk about Android animation, we generally say that there are Tween Animation (tween animation), Frame Animation (frame animation), and Property Animation (property animation). The differences between the three are as follows:

Tween Animation

​ Tween Animation is an animation launched by an early version of Android. It can mainly achieve four effects (zoom, translation, gradient, rotation), and animation can also be combined and sorted through AnimationSet. However, the tween animation is only applicable to the view, the limitation is relatively large, and it cannot change the real properties of the view. For beginners, it may be difficult to understand that you can't change the real properties of the view. For example, an ImageView uses a tween animation to pan and move from the left side of the screen to the right side of the screen. Visually, the View has moved, but if you Click on the ImageView, you will find that the position click after the animation is executed will not have its effect, this is because the animation does not change the real position of the ImageView, but draws it on the right side of the screen, the effect area of ​​the ImageVIew does not Changes occur, and the click event will still respond in the original position!

Frame Animation

In contrast, frame animation is much simpler. Its principle is to play a series of prepared pictures in sequence, and form an animation with the help of the residual effect of human vision, similar to the animation of flipping books quickly when we were young.

Property Animation

​ Attribute animation is the most used and most powerful animation effect today, and it is also the animation officially recommended by Android. After Android 3.0 (API 11), property animation was introduced, which is more powerful and flexible than View Animation. Property animation can realize all the effects of tween animation, and it can not only act on the view, but also on any Object. Property animation, as the name implies, can change the properties of an object, which is also a big difference from tweening animation.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325543124&siteId=291194637