31692

Question:
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);
Answer1:Have you tried setting up the Scroller interpolator as a LinearInterpolator? <a href="http://developer.android.com/reference/android/widget/Scroller.html#Scroller(android.content.Context,%20android.view.animation.Interpolator" rel="nofollow">http://developer.android.com/reference/android/widget/Scroller.html#Scroller(android.content.Context,%20android.view.animation.Interpolator</a>)
Sample:
yourScroller = new Scroller(yourContext, new LinearInterpolator());