To have your own scroll speed and flexibility to customize marquee properties, use the following:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:lines="1"
android:id="@+id/myTextView"
android:padding="4dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="Simple application that shows how to use marquee, with a long text" />
Within your activity:
private void setTranslation() {
TranslateAnimation tanim = new TranslateAnimation(
TranslateAnimation.ABSOLUTE, 1.0f * screenWidth,
TranslateAnimation.ABSOLUTE, -1.0f * screenWidth,
TranslateAnimation.ABSOLUTE, 0.0f,
TranslateAnimation.ABSOLUTE, 0.0f);
tanim.setDuration(1000);
tanim.setInterpolator(new LinearInterpolator());
tanim.setRepeatCount(Animation.INFINITE);
tanim.setRepeatMode(Animation.ABSOLUTE);
textView.startAnimation(tanim);
}