i have searched a lot but can't find any thing which help me to know How to scroll edit text content on change of seek bar based on the current position and progress.
Please help.....
public void startScrollingText() {
timer = new Timer();
System.out.println(CurrentValues.cur_script_speed
+ "its a current speed");
script_speed = (int) (100 - CurrentValues.cur_script_speed);
timer.schedule(new TimerTask() {
@Override
public void run() {
MainActivity.this.runOnUiThread(new Runnable() {
public void run() {
final Layout layout = script.getLayout(); // System.out.println(textview.getScrollY());
if (layout != null) {
int scrollDelta = layout.getLineBottom(script
.getLineCount() - 1)
- script.getScrollY()
- script.getHeight();
// System.out.println(scrollDelta);
if (scrollDelta > 0)
script.scrollTo(0, script.getScrollY() + 5);
// else
// script.scrollTo(0, 0);
System.out.println(CurrentValues.cur_script_speed
+ " current speed");
}
}
});
}
}, 1000, script_speed + 1);
}