Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;

import android.view.animation.Animation;

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

public class Main {

    public static void setRotateAnimation(View view, 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());
        view.startAnimation(mAnmation);
    }
}