To achieve this, use the Translation Framework interface, which works like:
TranslateAnimation(float fromXDelta, float toXDelta, float fromYDelta, float toYDelta)
So, you need to write your code to move in the x axis direction, as shown below:
mAnimation = new TranslateAnimation(0, 599, 0, 0); mAnimation.setDuration(10000); mAnimation.setFillAfter(true); mAnimation.setRepeatCount(-1); mAnimation.setRepeatMode(Animation.REVERSE); view.setAnimation(mAnimation);
source share