Create fade In animation for duration and delay - Android android.view.animation

Android examples for android.view.animation:Fade Animation

Description

Create fade In animation for duration and delay

Demo Code

import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Animation;

public class Main{

    public static void fadeIn(View view, long duration, long delay) {
        AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1);
        alphaAnimation.setDuration(duration);
        alphaAnimation.setStartOffset(delay);

        view.startAnimation(alphaAnimation);

    }// w  w  w  .j a  v  a2 s .c  o m

}

Related Tutorials