I have a TextView that represents the title of the current fragment and is located in the toolbar. When the user uses a big font size, the title sometimes becomes too long to be displayed completely. Hence I want to have it scroll to the right until the whole text has been shown, then stop for two seconds and then scroll back to the left where it stops as well. This should be repeated forever.
I have tried using marquee to accomplish this (see below), but there doesn't seem to be any option to make marquee stop scrolling, let alone dynamically reverse it. If there are any alternatives to marquee that have this option, I'd be happy to use them as well.
Currently the TextView looks like this:
<TextView
android:id="@+id/title_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"/>