Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if Webview scroll reach the end

am trying to figure out the max scroll position that the WebView can reach, i've tried the webView.pageDown(true) but the result is delayed ( i cant scroll it down, then up infront of the user, and this method doesn't work every time), i've tried also webView.getContentHeight() and the height isn't correct for Arabic content.

Please Advice

like image 923
Mohammad Ersan Avatar asked May 29 '12 07:05

Mohammad Ersan


1 Answers

ok, i figured out the answer

you can get the real content height using

(int) Math.floor(webView.getContentHeight() * webView.getScale());

when you get the real height, then just override the scroll method in webview to listen to scroll event, if the scroll reach the real height, your webview is in the bottom of the scroll.

like image 174
Mohammad Ersan Avatar answered Oct 17 '22 22:10

Mohammad Ersan