set Alpha Animation - Android Animation

Android examples for Animation:Alpha Fly Animation

Description

set Alpha Animation

Demo Code


//package com.java2s;
import android.view.animation.AlphaAnimation;
import android.view.animation.LinearInterpolator;

public class Main {

    public static void setAlphaAnim(float fromAlpha, float toAlpha,
            long duration) {
        AlphaAnimation alphaAnimation = new AlphaAnimation(fromAlpha,
                toAlpha);/*  w w w .  j av  a 2 s .  co  m*/
        alphaAnimation.setDuration(duration);
        alphaAnimation.setInterpolator(new LinearInterpolator());

    }
}

Related Tutorials