Java tutorial
//package com.java2s; //License from project: Open Source License import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.view.View; public class Main { public static void fade_GONE(final View view) { fade_GONE(view, 500); } public static void fade_GONE(final View view, int duration) { view.animate().alpha(0.0f).setDuration(duration).setListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); view.setVisibility(View.GONE); } }); } }