Android examples for android.animation:Animator
Create View gone Animator
//package com.java2s; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.view.View; public class Main { public final static String ALPHA = "alpha"; private final static int DEFAULT_VISBILITY_DURATION = 350; public static ObjectAnimator goneAnimator(View view) { ObjectAnimator gone = ObjectAnimator.ofFloat(view, View.ALPHA, 1f, 0f);/*from ww w. j a v a 2 s . c o m*/ gone.setDuration(DEFAULT_VISBILITY_DURATION); gone.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { view.setVisibility(View.GONE); } }); return gone; } }