Android examples for android.animation:Animator Fade
Create animate View Fade In Animator
//package com.java2s; import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; public class Main { public static Animator animViewFadeIn(View paramView) { return animViewFadeIn(paramView, 200L, null); }//from w ww. ja va 2 s .co m public static Animator animViewFadeIn(View paramView, long paramLong, Animator.AnimatorListener paramAnimatorListener) { ObjectAnimator localObjectAnimator = ObjectAnimator.ofFloat( paramView, "alpha", new float[] { 0.0F, 1.0F }); localObjectAnimator.setDuration(paramLong); if (paramAnimatorListener != null) localObjectAnimator.addListener(paramAnimatorListener); localObjectAnimator.start(); return localObjectAnimator; } }