I want to reverse the direction of marquee in the TextView. By default, the text moves from Right to Left, I want it to move from Left to Right. How can I do this?
Finally I found the BEST Solution here: https://github.com/Torob/MarqueeView
to use this library:
in your xml layout put your TextView inside of this MarqueeView like this:
<your.packagename.MarqueeView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/horizontalScrollView"
android:scrollbars="none"
android:visibility="visible"
android:clickable="false">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/test"
android:id="@+id/scrollingtext"
android:singleLine="true"
android:focusable="false"
android:focusableInTouchMode="false"
android:paddingRight="25dp"
android:paddingLeft="25dp" />
</your.packagename.MarqueeView>
Another simple way is using HTML and also you can change direction easily direction="Left"
<html><body><FONT COLOR="#000000" ><marquee id="mrqSlogan" direction="Left" style="width: auto;" >text your</marquee></FONT></body></html>
And Pass to WebView
webView.loadDataWithBaseURL(null, yourhtmltext, "text/html" , null, null);