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.animation.LinearInterpolator;

public class Main {
    public static void doSimpleRefresh(Object view) {
        LinearInterpolator interpolator = new LinearInterpolator();
        ObjectAnimator refreshAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
        refreshAnimator.setInterpolator(interpolator);
        refreshAnimator.setDuration(300);
        refreshAnimator.setRepeatCount(3);
        refreshAnimator.start();
    }

    public static void doSimpleRefresh(Object view, int repeat) {
        LinearInterpolator interpolator = new LinearInterpolator();
        ObjectAnimator refreshAnimator = ObjectAnimator.ofFloat(view, "rotation", 0f, 360f);
        refreshAnimator.setInterpolator(interpolator);
        refreshAnimator.setDuration(300);
        refreshAnimator.setRepeatCount(repeat);
        refreshAnimator.start();
    }
}