set Alpha Animation to a View - Android Animation

Android examples for Animation:Alpha Fly Animation

Description

set Alpha Animation to a View

Demo Code


//package com.java2s;

import android.view.View;
import android.view.animation.AlphaAnimation;

public class Main {

    public static void setAlphaAnimation(View v, int time, int repeatCount,
            int startOffset) {
        AlphaAnimation myAnimation_Alpha = new AlphaAnimation(0f, 1.0f);
        myAnimation_Alpha.setDuration(time);
        myAnimation_Alpha.setRepeatCount(repeatCount);
        myAnimation_Alpha.setStartOffset(startOffset);
        v.setAnimation(myAnimation_Alpha);
    }//w w w  . ja v a 2  s. c o m
}

Related Tutorials