Android examples for android.view.animation:Fade Animation
get Fade In Animation
import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.ScaleAnimation; import android.view.animation.TranslateAnimation; public class Main{ public static final int DURATION = 700; public static Animation getFadeInAnimation() { return getFadeInAnimation(DURATION * 2); }//from w w w .jav a 2 s. c o m private static Animation getFadeInAnimation(int duration) { AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f); alphaAnimation.setDuration(duration); return alphaAnimation; } private static Animation getFadeInAnimation(int duration) { AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f); alphaAnimation.setDuration(duration); return alphaAnimation; } public static Animation getFadeInAnimation() { return getFadeInAnimation(DURATION * 2); } }