Simple text run for Android scrolling

I want to create a scrollable text ticker for a simple Android application.

I have a large list of quotes stored in the array, and I would like to randomly fill my ticker with quotes: one quote scrolls completely, then another is randomly selected and scrolls its way to the end, etc.,

The ticker must break through, regardless of what it focuses on or hangs on ...

1) How to create a text ticker for these purposes?

2) How to fill a ticker with a constant stream of random quotes selected from my array?

thanks

+4
source share
1 answer

If I understand what you are trying to do correctly, you want to look at the ellipsize and marqueeRepeatLimit TextView properties.

Via API:

http://developer.android.com/reference/android/widget/TextView.html#attr_android:ellipsize

http://developer.android.com/reference/android/widget/TextView.html#attr_android:marqueeRepeatLimit

Also, look at this question for implementation. From what I remember when I had to implement something like this, XML properties can be complex. They interfere with each other and do not allow scrolling text on the screen, so it may take some time to play it correctly.

From there, filling it with different quotation marks is as simple as calling setText() on a TextView with a random sentence, which I assume you will store in an array or database at the right time.

+6
source

All Articles