If I run javascript on the WebView
while the WebView
is scrolling (with a finger on the screen), the view is not updated with a new look until the finger is lifted from the device, and the scroll stops.
To test this, I redefine onScroll
in WebView
and there I call some javascript that changes the background of the page to a random color. This happens again and again when the page scrolls. Thus, you must quickly flash different colors while scrolling.
However, on a Nexus S with gingerbread and a galactic Nexus with an ice cream sandwich, the color only updates when scrolling stops.
But on Xoom with Honeycomb, color constantly updates as you scroll. This is the desired result.
Any ideas on what's different on other devices and how to get WebView to update itself when scrolling through the Xoom method?
Thanks!
Additional Information: Just to indicate that javascript is received and received during scrolling, but the image showing these changes does not appear until the scrolling is complete. For example, if the javascript you call is console.log ('rawr'); Logs are displayed while scrolling.
found something in the source code . There is a WebView
method called startDrag () that calls WebViewCore.pauseUpdatePicture (mWebViewCore) , which prevents the image from updating while scrolling. In 3.0 they introduced WebSetting setEnabledSmoothTransition () , which you can see in code 4.0, allows you to disable the pause. However, this is only 3.0 or more, which means less than 3% in wild devices. Until now, I see no way to get around this in devices up to 3.0 ..... :(
source share