Android examples for android.view.animation:Animation
Animation to close Menu
import android.view.animation.Animation; import android.view.animation.Animation; import android.view.animation.RotateAnimation; import android.widget.RelativeLayout; public class Main{ public static void closeMenu(RelativeLayout rl, int startOffset) { for (int i = 0; i < rl.getChildCount(); i++) { rl.getChildAt(i).setEnabled(false); }/*from w ww. java2 s . c o m*/ RotateAnimation animation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 1); animation.setDuration(500); animation.setFillAfter(true); animation.setStartOffset(startOffset); animation.setAnimationListener(new MyAnimationListener()); rl.startAnimation(animation); } }