Animation: View Animation details, animationview details

Source: Internet
Author: User

Animation: View Animation details, animationview details
What is animation?

There are two scenarios for Animation:

The transparency, scaling, rotation, and translation changes (View animation) of the same image on the interface are constantly switched to display different images (Drawable animation) at the same position on the interface)

Animation Classification

View Animation Drawable Animation

Android provides two animation methods.

Xml configuration in pure encoding Mode

Animation is a very common interface effect in applications and a good way to improve user experience.

View animation category

Animation)

ScaleAnimation (AlphaAnimation) RotateAnimation (TranslateAnimation)

Composite animation (AnimationSet)

Public Functions of Animation combined by multiple single animations

SetDuration (long durationMillis): sets the duration (unit: ms)
SetStartOffset (long startOffset): Set the start Delay Time (unit: ms)
SetFillBefore (boolean fillBefore): sets whether the final starting state is fixed.
SetFillAfter (boolean fillAfter): sets whether the final state is fixed.
SetAnimationListener (AnimationListener listener): sets an animation listener.

Coordinate type:

Animation. ABSOLUTE Animation. RELATIVE_TO_SELF Animation. RELATIVE_TO_PARENT

Start the animation: view. startAnimation (animation );
End Animation: view. clearAnimation ()

Animation listener: AnimationListener

OnAnimationStart (Animation animation): Specifies the Animation start callback.

OnAnimationEnd (Animation animation): Specifies the Animation end callback.

OnAnimationRepeat (Animation animation): Repeated Animation execution

Zoom Animation

Method 1

FromX: scaling ratio on the X axis at the start toX: scaling ratio on the X axis at the end fromY: scaling ratio on the Y axis at the start toY: scaling ratio on the Y axis at the end limit txtype: X axis coordinate type (calculated offset on the X axis). txvlaue: offset of the center point on the X axis relative to the view's left Vertex on the X axis. tytype: Y axis coordinate type (calculation of the Offset on the X axis) pivotYValue: the offset of the center point relative to the left vertex of the view on the Y axis
 

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.