Create fade Out Animation - Android Animation

Android examples for Animation:Fade Animation

Description

Create fade Out Animation

Demo Code


//package com.java2s;

import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

public class Main {
    static int DURATION = 650;

    public static Animation fadeOut() {
        Animation fadeout = new AlphaAnimation(+1.0f, 0.0f);
        fadeout.setDuration(DURATION);//from   w  ww.  j av  a 2  s.  c  o m
        fadeout.setInterpolator(new AccelerateInterpolator());
        return fadeout;
    }
}

Related Tutorials