fade Out in milliseconds - Android Animation

Android examples for Animation:Fade Animation

Description

fade Out in milliseconds

Demo Code


//package com.java2s;
import android.os.Handler;
import android.view.View;

public class Main {
    public static void fadeOut(final View view, int millis) {
        view.animate().alpha(0f).setDuration(millis).setListener(null);
        new Handler().postDelayed(new Runnable() {
            public void run() {
                view.setVisibility(View.GONE);
            }//from w  ww  .  j  a v a 2s  .  co  m
        }, millis);
    }
}

Related Tutorials