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