Android examples for android.view.animation:Rotate Animation
get Upside down Animation
import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; public class Main{ public static RotateAnimation getUpsidedownAnimation(boolean clockwise, long durationMillis) { float fromDegrees, toDegrees; if (clockwise) { fromDegrees = -180;//from ww w . j ava2s . c o m toDegrees = 0; } else { fromDegrees = 0; toDegrees = -180; } RotateAnimation anim = new RotateAnimation(fromDegrees, toDegrees, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); anim.setInterpolator(new LinearInterpolator()); anim.setDuration(durationMillis); anim.setFillAfter(true); return anim; } }