Creating the running line with text - The Ticker

Put your problem here if it does not fit any of the other categories.

Creating the running line with text - The Ticker

Postby fresco » Tue Dec 18, 2007 12:03 pm

I want to create a running line with some text on the screen. The text should enter the screen from the right edge and exit to the left.
I found a Ticker object, that can do almost everithing I planned, but I still have a couple of problems. First the ticker stops when it reaches left edge, and I want him to keep running, and second how to restart the ticker so it can run forever ?
fresco
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sun Nov 18, 2007 10:36 am

Top

Postby plusminus » Tue Dec 18, 2007 4:34 pm

Hello fresco,

Have a look at the following functions:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         myTicker.resetTicker();
  2.  
  3.         myTicker.startTicker();
Parsed in 0.029 seconds, using GeSHi 1.0.8.4


Haven't tried it but this should restart the animation:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         aTicker.setTickerListener(new TickerListener(){
  2.  
  3.                         @Override
  4.  
  5.                         public void onTickerFinished(Ticker myTicker) {
  6.  
  7.                                 myTicker.resetTicker();
  8.  
  9.                                 myTicker.startTicker();
  10.  
  11.                         }
  12.  
  13.         });
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby fresco » Tue Dec 18, 2007 5:29 pm

Yes, I already checked these functions, and their behavior is weird. Sometimes it really restart the the ticker sometimes not. I think it depends on the current screen condition. Besides that I still can't make the ticker keep running after it reaches the edge of the screen.
fresco
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sun Nov 18, 2007 10:36 am

Postby plusminus » Tue Dec 18, 2007 6:32 pm

Hello fresco,

Tried a lot (also extending the Ticker) but got no solution for the scrolling out to the right.

:warning: NOTE: The stop-'Event' is not the child reaching the left edge of the ticker, but the right edge of the child reaching the right edge of the ticker :!:

Summarized: The Child-View scrolls until every pixel of it has been seen once.
:idea: Just make your text a bit longer than the screen ...

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby fresco » Tue Dec 18, 2007 7:26 pm

Thanks, I'll try.
fresco
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sun Nov 18, 2007 10:36 am

Postby LW » Mon Jan 07, 2008 2:54 pm

How can i change de Ticker speed? It sounds like I can't, but i noticed the Scroller class which could be usefull for this...It's about velocityX,duration etc...

But I don't understand how to use it with the ticker...


thx
LW
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Dec 31, 2007 2:05 pm

Top

Postby plusminus » Tue Jan 08, 2008 3:56 pm

Sorry LW,

haven't found sth. on the ticker-speed-issue yet :(

Perhaps someone else got an idea :?:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 8 guests