So I have a tutorials app on the play store.
In the tutorials activity I simply have a single textview
inside a scrollview
. The textview
is massive and may contain upwards of 5000 characters. I want to add an option to auto scroll since scrolling so much rubs my fingers raw and I think users may also feel the same since I got a few requests about this feature.
Once again, I want the user to tap the menu button, click the Auto Scroll option and the text should start scrolling smoothly, from wherever it's at to the end.
I found this:
public void scrollRight(final ScrollView h){
new CountDownTimer(10000, 25) {
public void onTick(long millisUntilFinished) {
h.scrollBy(1,0);
}
public void onFinish() {
}
}.start();
}
But I have a few doubts about this. Would this keep the user interface reactive? I mean even if it is auto scrolling I want the user to be able to move up or down by flinging all they want while it is still auto scrolling.
Further this might be a bit jittery on some devices, how do I make the scrolling smooth?
Above it runs for ten seconds, but I need it to run indefinitely. Is there a way I can calculate the max time needed to scroll? Or simply using a large number will work equally well? Say 1 million milliseconds?
Eventually I'd let the user set the scroll speed. But I reckon that will be easy once I get the basic auto scrolling right.