Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static final float ROTATION = 360f;
    private static final float PIVOT = 0.5f;
    private static final int ANIMATION_DURATION = 600;

    /**
     * Create a new rotating animation.
     * @return a rotation animation
     */
    public static RotateAnimation rotateAnimation() {
        RotateAnimation rotate = new RotateAnimation(0f, ROTATION, Animation.RELATIVE_TO_SELF, PIVOT,
                Animation.RELATIVE_TO_SELF, PIVOT);
        rotate.setDuration(ANIMATION_DURATION);
        rotate.setRepeatMode(Animation.RESTART);
        rotate.setRepeatCount(Animation.INFINITE);
        return rotate;
    }
}