Animation to show Menu - Android android.view.animation

Android examples for android.view.animation:Show Animation

Description

Animation to show Menu

Demo Code

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 showMenu(RelativeLayout rl, int startOffset) {

        for (int i = 0; i < rl.getChildCount(); i++) {
            rl.getChildAt(i).setEnabled(true);
        }/*from w w  w .j  a v  a 2  s. c  o m*/
        RotateAnimation animation = new RotateAnimation(-180, 0,
                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);

    }

}

Related Tutorials