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 y direction, as shown below:
mAnimation = new TranslateAnimation(0, 0, 0, 599); mAnimation.setDuration(10000); mAnimation.setFillAfter(true); mAnimation.setRepeatCount(-1); mAnimation.setRepeatMode(Animation.REVERSE); view.setAnimation(mAnimation);
Here the view can be any, textview, imageView, etc.
source share