have been chasing Guo Lin's blog and some of the new videos on IMOOC, and have recently talked about property animations.
The following is a study note of the blog learning and IMOOC video materials:
The more common animations before 3.0 are tween animations and frame animations:
Tween Animation: It is the object of the scene constantly changing the image to produce animation effects (rotation, translation, scaling and gradient);
Frame animation: The sequential playback of pre-made images, similar to the GIF picture principle, is similar to the movie effect.
After 3.0, in addition to supporting the above two animations, also added a new animation:
Property Animation----Attribute animation.
Traditional animation animation, old animation only suitable for display effect, not suitable for interactive animation
Translateanimation Displacement Animation
Although the ImageView can be moved, the ImageView cannot be clicked, and the old animation effect can be clicked.
Offloat The first parameter is the control to manipulate, the second is the property to manipulate, and the third and fourth is the scope of the operation.
Setduration is the length of time for the operation.
Property animations Click on the position of the control after the move to toast.
Enables the control to rotate 360 degrees.
Use of multiple Property animations:
To animate in order:
Animation Listener Events:
Another type of listener for adding events:
Layered animation Display style:
Setstartdelay () Setting the delay Time property
interpolated Values Device:
Setinterpolator (New Bounceinterpolator ());
Valueanimator
Content on the button in five seconds from 1 to 100:
The processing of the numerical value by the processing of the animation effect
Common Properties:
Translationx, translationy----offset distance
Rotation, RotationX, RotationY rotate animation,----Horizontal or vertical direction
Scalex,scaley----X-direction, zoom animation in Y-direction
X, Y, move to the exact coordinates.
Alpha Transparency
Common Methods and classes:
Valueanimator----Numerical Generator
Objectanimator----Valueanimator sub-class
Animatorupdatelistener---animated listener events
Animatorlisteneradapter
Propertyvaluesholder
Animatorset---- animation collection, which allows you to apply several animations to an object at the same time, which can be played simultaneously or different from the different animation settings. Start Offset
Typeevaluators---- calculates the value of the current time based on the starting and ending values of the attributes and the factors computed by the timeinterpolation
Interplators
Nterplators diagram:
accelerateinterpolator acceleration, slow intermediate acceleration at start
decelerateinterpolator slow down, start fast and slow down.
acceleratedecelerateinterolator acceleration and deceleration, slow start, middle acceleration
anticipateinterpolator Reverse, first change to the opposite direction and then accelerate the playback
anticipateovershootinterpolator Reverse add rebound, first change in the opposite direction, and then accelerate the play, will exceed the target value and then slowly move to the destination value
bounceinterpolator jump, fast to the destination value will jump, such as the destination value of 100, followed by the value may be 85,77,70,80,90,100
cycleiinterpolator cycle, animation cycle a certain number of times, the value is changed to a sine function: Math.sin (2 * mcycles * Math.PI * input)
linearinterpolator linear, linear uniform change
overshottinterpolator rebound, finally exceeding the target value and then slowly changing to the destination value
Timeinterpolator An interface that allows you to customize the Interpolator, the above several are implemented by this interface
Source: <http://www.cnblogs.com/angeldevil/archive/2011/12/02/2271096.html>
Related Advanced data:
Http://www.cnblogs.com/angeldevil/archive/2011/12/02/2271096.html
Animatorseth and Animatorlistener : http://blog.csdn.net/new_abc/article/details/40143091
animating with Objectanimator : http://blog.csdn.net/new_abc/article/details/40106569
animating with Valueanimator : http://blog.csdn.net/new_abc/article/details/40072499
Android Properties Animation