Classification of android--animations

Source: Internet
Author: User

Android contains three kinds of animations: View Animation, drawable Animation, property Animation (newly introduced with Android 3.0).

1, View Animation: That is to say the tweened Animation (tween animation). View animation is divided into four categories: Alphaanimation, Rotateanimation, Scaleanimation, translateanimation, respectively, corresponding to the transparency, rotation, size, displacement four kinds of changes.

It is a view-based gradient animation that only changes the view's drawing effect, while the actual property value remains unchanged. For example, the animation moves a button position, but the actual position of the button click remains unchanged. Defining animations in code can refer to subclasses of the Animationset class and animation, and XML files can be defined in the res/anim/folder if XML is used.

There are two drawbacks: (1) View animation generally can only modify some of the properties of the component (view Object), such as scaling and rotation, but cannot modify the background color of the component. (2) View animation The animation effect of a component to move a distance, such as moving from the left side of the screen to the right, in fact, the entire process is drawn out of the effect, the component's true position remains on the left side, only click on the left position to trigger the component. So to really move a component, you need to add code implementations after the animation ends.

2, drawable Animation: Also that is Frame-by-frame Animation (frame-wise animation). Load a series of drawable resources to create animations, a traditional animation that, in part, creates different sequences of images, which are played sequentially, just like film footage. Define animation frames in code, use the Animationdrawable class; XML files make it easier to compose animation frames in the Res/drawable folder.

3, Property Animation: Along a certain time order, by changing the view properties, so as to get animation effect. Make the "Seeing is real", after the animation, the property values of object objects are actually changed. Property animation can realize the view animation by changing the actual properties of the View object, and the view can automatically call invalidate () to refresh any time the View property is changed.

Classification of android--animations

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.