create Image Rotate Animation - Android Animation

Android examples for Animation:Rotate Animation

Description

create Image Rotate Animation

Demo Code


//package com.java2s;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;

public class Main {
    public static RotateAnimation createImageRotateAnimation(
            ImageView imageView) {
        RotateAnimation animation = new RotateAnimation(0f, 360f,
                imageView.getWidth() / 2, imageView.getHeight() / 2);
        animation.setInterpolator(new LinearInterpolator());
        animation.setRepeatCount(Animation.INFINITE);
        animation.setDuration(3000);/*from   w w w . j  ava 2s  . c  o  m*/
        return animation;

    }
}

Related Tutorials