I am writing an extension to stop the fling/scroll of the vertical scroll view. I am able to scroll to the top with the below function only when the scroll view is not in the motion/fling/on going scroll.
How to do scrolltoTop even though the scoll view is scrilling.
sceinario:
I have a VSA(vertical scroll arrangement), and a lable. I have text which is large and need to scroll down to see the content. I will scroll down and come back and then one another content, the that will also scroll.
@SimpleFunction(description = "Scroll to the top of vertical scrol view")
public void ScrollTop(VerticalScrollArrangement verticalScrollArrangement) {
final ScrollView scrollView = (ScrollView) verticalScrollArrangement.getView();
if (scrollView == null) {
return;
}
scrollView.scrollTo(0, 0);
}