Create Fade Out with ObjectAnimator - Android Animation

Android examples for Animation:Fade Animation

Description

Create Fade Out with ObjectAnimator

Demo Code


//package com.java2s;
import android.animation.ObjectAnimator;
import android.view.View;

public class Main {
    public static void FadeOut(View view, int duration) {
        ObjectAnimator fadeOut = ObjectAnimator.ofFloat(view, "alpha", 1f,
                0f);/*from   w  ww. ja  va2s. c o m*/
        fadeOut.setDuration(duration);
        fadeOut.start();
    }
}

Related Tutorials