Android Animation Learning (the difference between slow animations and property animations)

Source: Internet
Author: User

Objective:

In Android Animation Learning (Overview), if you read this post, you should have questions about the difference between slow animations and property animations, because in their applications you will feel that the two animations have some similarities, I'm going to explain the difference between the two animations.

Difference:

Here is an official document for the difference between the two animations (I said the ease of animation corresponding to the following article in English: View Animation, property animation corresponding to the following text in English: Animation):

How to Animation differs from View Animation

The View animation system provides the capability to only animate view objects, so if you wanted to animate N On-view objects, you had to implement your own code to doing so. The View animation system is also constrained in the fact that it's only exposes a few aspects of a view object to Animate, such as the scaling and rotation of a View but not the background color, for instance.

Another disadvantage of the view animation system is that it's only modified where the view was drawn, and not the actual Vi EW itself. For instance, if you animated a button to move across the screen, the button draws correctly and the actual location wher E You can click the button does is not a change and so do have a to implement your own logic to handle this.

With the property animation system, these constraints is completely removed, and you can animate any property of any Obje CT (views and non-views) and the object itself are actually modified. The property animation system was also more robust in the the-it carries out animation. At-a high level, you assign animators to the properties of the want to animate, such as color, position, or size and can Define aspects of the animation such as interpolation and synchronization of multiple animators.

The view animation system, however, takes less time-to-setup and requires less code to write. If view animation accomplishes everything so need to do, or if your existing code already works the-the-the-the-the-the- Ere is no need-the property animation system. It also might make sense to use both animation systems for different situations if the use case arises.

From the English description in the text, the slow animation and property animation are mainly three points:

1. An action object for an easing animation can only be an object of the view type, whereas an action object of a property animation may be a view or not a view. Because the action object of an easing animation can only be an object of the view type, it can manipulate properties that only the view has, which also results in an easing animation with a narrower face than the property animation can apply.

2. Slow animation when the Translate property changes, if it is a button object, then when it moves, its click area does not move with the button movement, you can click on the location of the first draw it will trigger the Click event, Clicking on a button in the move does not trigger the Click event, which requires you to write your own logic to handle the situation. This is not the case with property animations, which are much more reliable than slow animations. For more advanced requirements, such as: color, location, size, and where multiple animations and interpolator are used simultaneously, you might want to use property animations.

Finally, the article explains why you should use an easing animation, because the slow animation requires only a small amount of code to achieve the animation effect. If an easing animation satisfies your needs, or your existing code already uses it, you don't need to modify it to use property animations. In some cases, you might mix ease animations with property animations.

Related documents:

The difference between a property animation and a gentle animation

Https://developer.android.com/guide/topics/graphics/prop-animation.html

Android Animation Learning (the difference between slow animations and property animations)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.