Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect marquee text end listener? [duplicate]

I want to marquee text, and when the marquee completes (the 1 full marquee cycle), I want to trigger another event. Is there a good way to do this? I haven't seen an OnEnd or similar function when marquee-ing a textview

like image 219
RyanInBinary Avatar asked Sep 12 '12 16:09

RyanInBinary


People also ask

How to use marquee stop method in HTML?

The Marquee stop method in HTML is used to stop the scrolling. To start the scrolling use start () method . Note: This property is depreciated from HTML 5. Return value: This method has no return value. Supported Browsers: The browsers supported by HTML Marquee stop Method are listed below: Writing code in comment?

What does repeat the marquee text mean?

With repeat I mean that the text will just start over right behind where the marquee is So when I have the marquee text " Hello poeple of the earth •", and that is here:

How do I duplicate text in a marquee?

You make sure the text is more than twice the width of the screen, then use negative translate animations to do the marquee movement. You’ll probably want to aria-hidden all but one of them if you need to duplicate the text.

What happens to the first and third marquee after completing loops?

First and third marquee will stop after completing the given number of loops, you need to refresh this page again to move them. If playback doesn't begin shortly, try restarting your device.


1 Answers

using a custom TextView, you can override onDraw to use reflection on mMarquee field and on mStatus field of the mMarquee field (see TextView code on grepcode or such).

mStatus value is 2 when marquee is running, and 0 when stopped.

onDraw is called a lot, but in particular, it is called right after the marquee is completed.

like image 152
njzk2 Avatar answered Sep 29 '22 10:09

njzk2