I know in Scrollview you can access scrollView.getMaxScrollAmount however I don't seem to understand how to call it on webview. I tried cheating to get the information about it. Here is what I tried.
What the method was suppose to do is that it continually scroll in a specific amount and checks if the value isn't increased in that amount it gets that amount and returns it with the max value. However it doesn't work.
public String scrollToMAX(){
webView1.scrollTo(0, 0);
Boolean istrue = true;
String getIntData = "";
int i = 0;
while(istrue){
int checker = webView1.getScrollY();
if(i != checker){
i = checker;
getIntData = Integer.toString(i);
istrue = false;
}
i=i+5000;
webView1.scrollTo(0, i);
}
webView1.scrollTo(0, 0);
return getIntData;
//Put a return string here
}
A bit late, but if anyone needs the answer, webview has a protected method - computeVerticalScrollRange() - if you want to know the max scroll range you can override the WebView and return computeVerticalScrollRange() - getHeight()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With