Android examples for Animation:Animation Creation
settings In Path Animation
//package com.java2s; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.view.animation.TranslateAnimation; public class Main { static public Animation settingsInPathAnimation() { AnimationSet animationSet = new AnimationSet(true); RotateAnimation rotate_360 = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rotate_360.setDuration(900);//from w w w . j a va 2 s .c o m rotate_360.setInterpolator(new LinearInterpolator()); Animation step1 = new TranslateAnimation(Animation.ABSOLUTE, -720, Animation.ABSOLUTE, -660, Animation.ABSOLUTE, 280, Animation.ABSOLUTE, 0); step1.setDuration(300); step1.setInterpolator(new LinearInterpolator()); Animation inFromLeft = new TranslateAnimation(Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 660, Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f); inFromLeft.setDuration(500); inFromLeft.setInterpolator(new LinearInterpolator()); animationSet.addAnimation(rotate_360); animationSet.addAnimation(step1); animationSet.addAnimation(inFromLeft); return animationSet; } }