get 360 Rotate Animation - Android Animation

Android examples for Animation:Rotate Animation

Description

get 360 Rotate Animation

Demo Code


//package com.java2s;

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

public class Main {

    public static Animation get360RotateAnimation() {

        Animation operatingAnim = new RotateAnimation(0f, 359f,
                Animation.RELATIVE_TO_SELF, 0.5f,
                Animation.RELATIVE_TO_SELF, 0.5f);
        operatingAnim.setDuration(500);/*from   w  w  w .j a  v a  2s  .c o m*/
        operatingAnim.setFillAfter(true);
        operatingAnim.setRepeatCount(-1);
        LinearInterpolator lin = new LinearInterpolator();
        operatingAnim.setInterpolator(lin);
        return operatingAnim;
    }
}

Related Tutorials