I have been trying to give the marquee effect for the word HELLO in my application but android does not allow the same unless the length of the text exceeds the screen size.
To apply tickr/marquee animation on text view(even for short text length), it creates an translatory animation from extreme right(+1f) to extreme left(-1f) and then restarts the animation.
public void setTickerAnimation(View view) {
Animation animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, +1f,
Animation.RELATIVE_TO_SELF, -1f,
Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 0f);
animation.setRepeatCount(Animation.INFINITE);
animation.setRepeatMode(Animation.RESTART);
animation.setInterpolator(new LinearInterpolator());
animation.setDuration(4000);
view.startAnimation(animation);
}