Android examples for Animation:Animation Creation
undo Stick To Animation
//package com.java2s; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.view.View; import android.view.ViewGroup; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; public class Main { private static final int ANIMATE_DURATION = 700; private static final Interpolator ANIMATE_INTERPOLATOR = new AccelerateDecelerateInterpolator(); public static void undoStickTo(final View v, ViewGroup main) { v.setLayerType(View.LAYER_TYPE_HARDWARE, null); v.animate().y(main.getHeight()).alpha(0) .setDuration(ANIMATE_DURATION) .setInterpolator(ANIMATE_INTERPOLATOR) .setListener(new AnimatorListenerAdapter() { @Override/*from ww w. j ava 2 s. c o m*/ public void onAnimationEnd(Animator animation) { v.setLayerType(View.LAYER_TYPE_NONE, null); super.onAnimationEnd(animation); } }).start(); } }