How make text moving from left to right in Android?

android, textview

Solution

Use below xml code in anim folder under res :

<?xml version="1.0" encoding="utf-8"?>
<set
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/linear_interpolator"
    android:fillAfter="true">

   <translate
        android:fromXDelta="-3%p"
        android:toXDelta="3%p"
        android:duration="1200" />
</set>

And, just add this to your textview :

yourTextView.startAnimation(AnimationUtils.loadAnimation(activity, R.anim.move));

Problem

I use this code to make text move and it moves correctly from right to left. Nevertheless, I want to make the text in TextView move from left to right. Here is my current code: ``` <TextView android:id="@+id/mylinenews" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="5" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:singleLine="true" android:text="textmoving textmoving textmoving textmoving textmoving textmoving textmoving textmoving textmoving textmoving " android:textColor="#fff" /> ``` How can I modify this code so the text moves from left to right?

Original source