Java tutorial
//package com.java2s; //License from project: Apache License import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.view.View; public class Main { private static final long ANIM_DURATION_INFLATE = 200; public static ObjectAnimator inflate(final View v) { PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f); PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f); ObjectAnimator animator = ObjectAnimator.ofPropertyValuesHolder(v, scaleX, scaleY); animator.setDuration(ANIM_DURATION_INFLATE); animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { v.setVisibility(View.VISIBLE); } }); return animator; } }