Animations in Android

Source: Internet
Author: User

1. View Animation

The view animation creates an animated effect by constantly making image transformations ( panning, zooming, rotating, transparency ) on the objects in the scene, which is a progressive animation. View animations support Customization.

The four transformations of the view animation correspond to the four subclasses of animation: Translateanimation,scaleanimation,rotateanimation and Alphaanimation.

Custom Animation: simply inherit the animation abstract class, then rewrite its initialize and Applytransformation methods to do some initialization work in the Initialize method, The corresponding matrix transformations are performed in the applytransformation.

Layoutanimation acts on ViewGroup, specifying an animation for ViewGroup, which is animated when the child elements of ViewGroup appear.

2. Frame animation

Frame Animations play a series of images in sequence to produce animated effects, which can be easily understood as switching animations for pictures. Frame animations are part of a view animation. The Animationdrawable class is provided to use frame animations.

Frame animations are prone to oom, so try to avoid using too many larger images when using them.

3. Attribute Animation

Property animation is animated by dynamically changing the properties of an object , and for the new feature of API11, the property animation cannot be used directly in the lower version, but it can be used through a compatible library.

There are valueanimator,objectanimator , and animatorset concepts in property animations that enable brilliant animations.

Where Objectanimator inherits Valueanimator,animatorset is the animation collection.

4. Understanding the Interpolator and the estimator

Timeinterpolator Chinese translation is a time interpolator whose function is to calculate the percentage of the current attribute value change based on the percentage of elapsed time .

Typeevaluator's Chinese translation is a type valuation algorithm, also known as an estimator, whose role is to calculate the changed attribute value based on the percentage of the current attribute change.

The interpolation and estimator in property animations are important, and they are an important means of achieving a non-uniform animation.

Animations in Android

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.