Android examples for android.view.animation:Fade Animation
fade Out View with AlphaAnimation
import android.view.View; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; public class Main { public static void fadeOut(View view) { if (view.getVisibility() != View.VISIBLE) return;/*from w w w .ja va2 s . c o m*/ // Since the button is still clickable before fade-out animation // ends, we disable the button first to block click. view.setEnabled(false); Animation animation = new AlphaAnimation(1F, 0F); animation.setDuration(400); view.startAnimation(animation); view.setVisibility(View.GONE); } }