Java tutorial
//package com.java2s; import android.view.View; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.view.animation.Animation.AnimationListener; public class Main { public static void SlideInRight(View v, final Runnable onComplete) { v.clearAnimation(); TranslateAnimation aout = new TranslateAnimation(Animation.RELATIVE_TO_SELF, -1f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f); aout.setDuration(300); v.startAnimation(aout); if (onComplete != null) aout.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation arg0) { } @Override public void onAnimationRepeat(Animation arg0) { } @Override public void onAnimationEnd(Animation arg0) { onComplete.run(); } }); } }