Create fade In Animation for Longer time - Android Animation

Android examples for Animation:Fade Animation

Description

Create fade In Animation for Longer time

Demo Code


//package com.java2s;

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

import android.view.animation.LinearInterpolator;

public class Main {
    public static Animation fadeInLong(
            final android.view.animation.Animation.AnimationListener animationlistener) {
        final AlphaAnimation alphaanimation = new AlphaAnimation(0F, 1F);
        alphaanimation.setDuration(600L);
        alphaanimation.setInterpolator(new LinearInterpolator());
        alphaanimation.setAnimationListener(animationlistener);
        return alphaanimation;
    }//from   w  ww.  ja  v  a  2s. c om
}

Related Tutorials