The marquee animation does not work, this is what I did.
<LinearLayout android:layout_height="wrap_content"
android:layout_width="wrap_content" android:background="@drawable/bg_trans"
android:layout_alignParentBottom="true" android:orientation="vertical">
<TextView android:id="@+id/trackName"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:textColor="@android:color/white" android:textSize="18sp"
android:maxLines="2" android:ellipsize="marquee"
android:scrollHorizontally="true"
android:focusable="true" android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:layout_gravity="center_horizontal" />
<TextView android:id="@+id/artistName"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:textColor="@android:color/white" android:textSize="18sp"
android:maxLines="2" android:ellipsize="marquee"
android:scrollHorizontally="true"
android:focusable="true" android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:layout_gravity="center_horizontal" />
</LinearLayout>
It works for the first textview but doens’t work for the second. What am I doing wrong?
This works for me –
The field
marqueeRepeatLimitwill set the number of repitions.UPDATE: The width of the text view need to be hardcoded to a specific value, you can set it to
wrap_content. In such cases the marquee will still work just that it will have some blank space after the end the text and before it starts to display the text again. (Think Digital signboards, they have some gap in the display before displaying the next item.)