create Fade Out Animator - Android android.animation

Android examples for android.animation:Animator Fade

Description

create Fade Out Animator

Demo Code


//package com.java2s;
import android.animation.Animator;
import android.animation.ObjectAnimator;

import android.view.View;

import android.view.animation.LinearInterpolator;

public class Main {
    public static Animator createFadeOutAnimator(View view) {
        ObjectAnimator anim = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f);
        anim.setInterpolator(new LinearInterpolator());
        anim.setDuration(250);/*from   www.j  a v  a 2s. co  m*/

        return anim;
    }
}

Related Tutorials