I am using marquee in two different TextViews of my widget.But it is working only either for first or the second TextView when i am trying with different combinations of "android:focusable="true"",android:focusableInTouchMode="true" and android:duplicateParentState="true". I want both of the TextViews to be moving. I am giving below the code I am using .
<TextView
android:id="@+id/place"
android:layout_width="94dip"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:lines="1"
android:textColor="@color/white"
android:focusable="true"
android:focusableInTouchMode="true"
>
<requestFocus
android:duplicateParentState="true"
/>
</TextView>
<TextView
android:id="@+id/weather_report"
android:layout_width="110dip"
android:layout_height="wrap_content"
android:layout_below="@+id/place"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:lines="1"
android:textColor="@color/grey"
android:focusable="true"
android:focusableInTouchMode="true"
>
<requestFocus
android:duplicateParentState="true"
/>
</TextView>
Can anyone know the solution?
I'm pretty sure you can't do what you want. Only focused views can "marquee", and since you cannot have two focused views then it's impossible to do what you want out of the box. However, you can look at the startMarquee() method in the TextView and extend a custom TextView that always marquees.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With