Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
650 views
in Technique[技术] by (71.8m points)

android - Possible to detect when a TextView's marquee animation has completed?

If I set a TextView's ellipsize value to "marquee" and the marqueeRepeatLimit value to "1" for example (in order to roll a long text across a TextView once), is there any way to detect when the marquee animation has completed?

(Thing is, I have a queue of Strings which is being added to dynamically and I want to pull out and show one of these Strings at a time. A String can be longer than the width of the TextView so I want to roll it across before I show the next one.)

Edit: If it's not possible to do this by using TextView's marquee properties, anyone know how can I add an Animation to a TextView which simulates a marquee animation?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

instead of marquee just try the simple animation on the text, there you can define in which style text should move, with what speed and direction.
You can set the result to show after the animation is complete by using "setFillAfter()" method (showing the default text in your case).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...