Android examples for Animation:Slide Animation
start Softly Slide Up
//package com.java2s; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Context; import android.view.View; import android.view.animation.DecelerateInterpolator; public class Main { public static void startSoftlySlideUp(final View view, final int duration) { Context context = view.getContext(); final int translateY = context.getResources().getDisplayMetrics().heightPixels; view.animate().translationY(translateY).setDuration(0) .setListener(new AnimatorListenerAdapter() { @Override//from w ww . j a va2 s . c om public void onAnimationEnd(Animator animation) { view.animate() .translationY(0) .setStartDelay(duration) .setInterpolator( new DecelerateInterpolator()) .setDuration(duration).setListener(null); } }); } }