Java tutorial
//package com.java2s; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; public class Main { public static RotateAnimation getRotateAnimation(float fromAngle, float toAngle, float pivotX, float pivotY, int intDuration, int intRepeatCount, boolean boolFillAfter) { RotateAnimation mAnmation = new RotateAnimation(fromAngle, toAngle, Animation.RELATIVE_TO_SELF, pivotX, Animation.RELATIVE_TO_SELF, pivotY); mAnmation.setDuration(intDuration); mAnmation.setFillAfter(boolFillAfter); if (intRepeatCount != 1) { mAnmation.setRepeatMode(Animation.RESTART); mAnmation.setRepeatCount(intRepeatCount); } // mAnmation.setInterpolator(AnimationUtils.loadInterpolator(mContext, // com.webclient.R.anim.bounce_interpolator)); mAnmation.setInterpolator(new LinearInterpolator()); return mAnmation; } }