Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.animation.ScaleAnimation;

public class Main {
    private static final long DEFAULT_DURATION = 300;

    public static ScaleAnimation getScaleAnim(float fromScale, float toScale, long duration) {
        if (duration <= 0) {
            duration = DEFAULT_DURATION;
        }
        ScaleAnimation anim = new ScaleAnimation(fromScale, toScale, fromScale, toScale, 0.5f, 0.5f);
        anim.setDuration(duration);
        anim.setFillAfter(true);
        return anim;
    }
}