get Rotate Animation - Android android.view.animation

Android examples for android.view.animation:Rotate Animation

Description

get Rotate Animation

Demo Code

import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;

public class Main {

  public static RotateAnimation getRotateAnim() {
    RotateAnimation animation = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f,
        Animation.RELATIVE_TO_SELF, 0.5f);
    animation.setRepeatCount(-1);/*from  ww  w . j  a va  2s .  c om*/
    animation.setDuration(1000);
    animation.setInterpolator(new LinearInterpolator());
    return animation;
  }

}

Related Tutorials