Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;

public class Main {
    public static void animateScaleIn(View view, long duration, Animator.AnimatorListener listener) {
        view.setScaleX(0f);
        view.setScaleY(0f);
        view.setVisibility(View.VISIBLE);

        AnimatorSet scaleSet = new AnimatorSet();
        scaleSet.playTogether(ObjectAnimator.ofFloat(view, View.SCALE_X, 1f),
                ObjectAnimator.ofFloat(view, View.SCALE_Y, 1f));
        scaleSet.setInterpolator(new AccelerateDecelerateInterpolator());
        scaleSet.setDuration(duration);
        if (listener != null) {
            scaleSet.addListener(listener);
        }
        scaleSet.start();
        //return scaleSet;
    }
}