Nikki
Nikki

Reputation: 3318

how to maintain the speed of scroller?

I have a problem while using the scroller in my application.

I have used the scroller but it is not working properly as it is not able to maintain a consistent speed while automatically scrolling. The speed of the text is getting slower with time as the text moves upward.

Here is the code that I used for this purpose:

length = prompt_text.getLineCount();
Log.d("length",""+length);
prompt_text.setScroller(scroll);
scroll.startScroll(0,0,0,10 * length, 100000 / speedAmount);

Upvotes: 1

Views: 2244

Answers (1)

Ander Webbs
Ander Webbs

Reputation: 1158

Have you tried setting up the Scroller interpolator as a LinearInterpolator? http://developer.android.com/reference/android/widget/Scroller.html#Scroller(android.content.Context,%20android.view.animation.Interpolator)

Sample:


yourScroller = new Scroller(yourContext, new LinearInterpolator());

Upvotes: 4

Related Questions