Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.animation.ObjectAnimator;

import android.view.View;

public class Main {
    public static void spinOnceX(View view, int cameraDistance, int duration, boolean forward) {
        view.setCameraDistance(cameraDistance);

        ObjectAnimator animator = ObjectAnimator.ofFloat(view, "rotationX", 0.0f, forward ? 360.0f : -360.0f);
        animator.setRepeatMode(ObjectAnimator.REVERSE);
        animator.setDuration(duration);
        animator.start();
    }
}