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.animation.ObjectAnimator;
import android.view.View;

public class Main {
    private static int defaultDuration = 500;

    public static void animRotate(View view, float fromDegrees, float toDegrees) {
        animRotate(view, fromDegrees, toDegrees, defaultDuration);
    }

    public static void animRotate(View view, float fromDegrees, float toDegrees, int duration) {
        ObjectAnimator.ofFloat(view, "rotation", fromDegrees, toDegrees).setDuration(duration).start();
    }
}