How to auto scroll bottom-to-top at a particular position in ScrollView to make it look like as Drag-to-scroll-up in ScrollView?
Basically, I want to create a wheel that spins from bottom to top with smoothly.
How to auto scroll bottom-to-top at a particular position in ScrollView to make it look like as Drag-to-scroll-up in ScrollView?
Basically, I want to create a wheel that spins from bottom to top with smoothly.
You can make scrollview to scroll and add some sleep for smooth scrolling :
private void sendScroll(ScrollView scrollView){
final Handler handler = new Handler();
new Thread(new Runnable() {
@Override
public void run() {
try {Thread.sleep(100);} catch (InterruptedException e) {}
handler.post(new Runnable() {
@Override
public void run() {
scrollView.fullScroll(View.FOCUS_UP);
}
});
}
}).start();
}
Add the below lines :
scroll.scrollTo(0, scroll.getBottom());
in your XML add:
android:focusable="true"
android:focusableInTouchMode="true"