Java tutorial
//package com.java2s; import android.view.View; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; public class Main { public static void setTranslateAnimationToSelf(View view, float pivotFromX, float pivotToX, float pivotFromY, float pivotToY, int intDuration, boolean boolFillAfter) { TranslateAnimation mAnmation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, pivotFromX, Animation.RELATIVE_TO_SELF, pivotToX, Animation.RELATIVE_TO_SELF, pivotFromY, Animation.RELATIVE_TO_SELF, pivotToY); mAnmation.setDuration(intDuration); mAnmation.setFillAfter(boolFillAfter); // mAnmation.setRepeatMode(Animation.RESTART); // mAnmation.setRepeatCount(intRepeatCount); // mAnmation.setInterpolator(AnimationUtils.loadInterpolator(mContext, // com.webclient.R.anim.bounce_interpolator)); view.startAnimation(mAnmation); } }