This was asked elsewhere, but the solution did not work for me. So this again creates more context. The problem is that the action contains a scrollable text representation of the music title, which is interrupted by an updated view of the elapsed time counter text.
I have two kinds of TextView widgets in my activity layout (although they are included in other layout layouts).
<TextView android:id="@+id/v_current_time" android:minWidth="26dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:gravity="right|center_vertical" android:singleLine="true" android:textSize="12sp" android:enabled="false" /> <TextView android:id="@+id/v_track_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="18sp" android:textStyle="normal" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:focusable="true" android:focusableInTouchMode="true" android:enabled="true" />
The name of the music is dynamically set to (in the test case) a long line of text. If I never update the text during the current time with the next line, the name of the music will joyfully scroll forever no matter how I interact with the pause and play buttons.
tvCurrentTime.setText(DataFormat.formatTime(progress));
But if I set the text for the current time, the name of the music will stop. Pressing my pause button somehow starts to scroll back, but pressing play will update the current time and restart.
As per the suggestion in this thread, I tried to associate the time text setting with re-enabling the scroll header as follows:
tvCurrentTime.setText(DataFormat.formatTime(progress)); tvTitle.setEnabled(true);
This does not affect the failure, except for resetting the scroller each time it is restarted.
Are there any details that I'm missing, or any other thoughts on what might go wrong? Many thanks!
android scroll marquee
Groovee60
source share