private void Startcodeanim () {Animationset animationset = new Animationset (true);//alphaanimation alphaanimation = new Alphaanimation (0, 1);//alphaanimation.setduration (+);//alphaanimation.setstartoffset (10000);// Scale scaling ratio from twice to 1 (original size) scaleanimation scales = new Scaleanimation (2.0f, 1.0f, 2.0f, 1.0f,animation.relative_to_self, 0.5f, Animation.relative_to_self, 0.5f); scale.setduration (1000);//Animation playback interval animationset.addanimation (scale);// Rotate 20 degrees in reverse direction rotateanimation rotate =new rotateanimation (0f,-20f,animation.relative_to_self, 0.5f, animation.relative_to_self,0.5f); Rotate.setduration (+); animationset.addanimation (rotate);//translate moves from the original position to the positive direction of X and Y 10% of the original picture size Distance translateanimation translate = new Translateanimation (animation.relative_to_self, 0f, Animation.relative_to_self, 0.1f, Animation.relative_to_self, 0f, Animation.relative_to_self, 0.1f); translate.setduration (1300); Animationset.addanimation (translate);//animationset.setstartoffset (10000);//animationset.setfillbefore (false) ;//settings do not play after the animation is notReturn to original position animationset.setfillafter (true);//Add and Play animation iv1.startanimation (Animationset);}
Code Animation writing