Excessive animation

1.AlphaAnimation (transparency animation)

2.ScaleAnimation (zoom animation)

3.TransalteAnimation (panning animation)

4.RotateAnimation (rotation animation)

 

Animation look under the common properties

 

Anim new new AlphaAnimation = Animation (1,0.1f); 
// set the animation execution duration (1 sec) 
anim.setDuraion (1000); 
// save the animation effect after performing (1) 
anim.setFillAfter (to true); 
Anim. setFillBefore (to true); 
// Loop animation (2) 
anim.setRepeatCount (. 1); 
// reverse play the animation (. 3) 
anim.setRepeatMode (2)

 

(1) After saving effects animation execution:

 After the animation execution setFillAfter stay in the last frame of the animation, and setFillBefore stay in the first frame of the animation, an analogy, click the icon to move from point A to point B, setFillAfter picture will stay in the B point (although the icon is displayed in point B, but the location is still in the control point a, this time click on the icon no effect, click a point will perform the animation again), and setFillBefore icon will remain at the origin (after watching the execution seems to be no effect).

(2) Repeat the animation:

  setRepeatCount can only use an int value, if the fill value is negative, the animation will be infinitely repeated play. Is 0 or an integer, the number of repeat of adding 1 to the original value, such a value of 0, it will be performed once, a value of 2, it will execute three times.

(3) Reverse play the animation:

  Explain reverse play the animation, such as panning effect, click on the icon, the icon will move from point A to point B, then it will be back to point A from point B to move. setRepeatMode needs and setRepeatCount used in conjunction with, or else there will be no effect. setRepeatMode also use an int value, a little research and found that its value can only be 2, and setRepeatCount fit, value setRepeatCount only -1 and 1, and the other will have no effect. setRepeatCount value of 1, the effect of the whole process (from there to and from scratch) to achieve a value of -1 entire process will loop indefinitely.

 

Transparency Animation:

 

Zoom animation:

Panning animation:

Rotation animation:

Guess you like

Origin www.cnblogs.com/Mr-Deng/p/12053611.html