How to animate a text view like marquee?

I have a text view that I need to highlight on the screen (for example, flash news flashing on news channels) using animation. How can I implement this in android, I tried this answer

but didn’t get a solution, please help?

+4
source share
1 answer

main.xml

<TextView android:id="@+id/mywidget" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:lines="1" android:ellipsize="marquee" android:fadingEdge="horizontal" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:textColor="#ff4500" android:text="Simple application that shows how to use marquee, with a long text" /> 

java class

  TextView tv = (TextView) this.findViewById(R.id.mywidget); tv.setSelected(true); // Set focus to the textview 
+7
source

Source: https://habr.com/ru/post/1395898/


All Articles