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 animScale(View view, float fromX, float toX, float fromY, float toY) {
        animScale(view, fromX, toX, fromY, toY, defaultDuration);
    }

    public static void animScale(View view, float fromX, float toX, float fromY, float toY, int duration) {
        ObjectAnimator.ofFloat(view, "scaleX", fromX, toX).setDuration(duration).start();
        ObjectAnimator.ofFloat(view, "scaleY", fromY, toY).setDuration(duration).start();
    }
}