Android examples for Activity:Activity Start
get Activity Resume Animation
//package com.java2s; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.TranslateAnimation; public class Main { public static final int DURATION = 700; public static Animation getActivityResumeAnimation() { AnimationSet animationSet = new AnimationSet(false); AlphaAnimation alphaAnimation = (AlphaAnimation) getFadeInAnimation(DURATION); TranslateAnimation translateAnimation = new TranslateAnimation( Animation.RELATIVE_TO_PARENT, -1f, Animation.RELATIVE_TO_PARENT, 0f, Animation.RELATIVE_TO_PARENT, 0f, Animation.RELATIVE_TO_PARENT, 0f); translateAnimation.setDuration(DURATION); animationSet.addAnimation(alphaAnimation); animationSet.addAnimation(translateAnimation); animationSet.setFillAfter(false); return animationSet; }// ww w.j a v a 2 s.com public static Animation getFadeInAnimation() { return getFadeInAnimation(DURATION * 2); } private static Animation getFadeInAnimation(int duration) { AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f); alphaAnimation.setDuration(duration); return alphaAnimation; } }