Create Alpha Animation - Android Animation

Android examples for Animation:Alpha Fly Animation

Description

Create Alpha Animation

Demo Code


//package com.java2s;

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

public class Main {

    public static Animation getAlphaAnimation(float fromAlpha,
            float toAlpha, long durationMillis) {
        AlphaAnimation alpha = new AlphaAnimation(fromAlpha, toAlpha);
        alpha.setDuration(durationMillis);
        alpha.setFillAfter(true);//from  ww  w.j  av  a2  s  .co  m
        return alpha;
    }
}

Related Tutorials