Preface: always take the native android4.4 NEXUS5 test, the results loaded into the eldest brother Millet, out of the bug. Android compatibility problem really .... Difficult to describe.
Bug Detailed Description: I use webview run JS Goole map, alone use the webview when everything is normal, and when placed in ScrollView and Viewpager, Millet mobile phone will not be able to move the map, other mobile phone is no problem.
Solution:
First, ScrollView nested sets of WebView
As a novice, I simply checked the return values of the three functions of Viewpager and ScrollView (Dispatchtouchevent, Onintercepttouchevent, ontouchevent), There seems to be no difference between millet and other mobile phones.
After reading a post on the "touch event delivery mechanism" (portal http://www.xuebuyuan.com/610044.html), I tried the demo and finally found out where the problem was.
Xiaomi's ScrollView will mask the upper and lower gestures of all its sub-view, which will give the child View Motionevent.action_cancel event, which will cause subsequent motionevent events to be passed only to the ScrollView cutoff.
So I changed the return value of Onintercepttouchevent to false, and it's going to be weird here, as I said before, and here's the solution, I didn't go into it, The initial guess is that the millet system changed the Onintercepttouchevent function code of the native ScrollView, making the Motionevent event passed to the child view become motionevent.action_cancel.
Second, Viewpager nested sets of WebView
This thought solved the previous problem, the problem should be similar, the result is useless. Strangely, all touchevent-related functions of Viewpager and WebView are exactly the same as those printed on Xiaomi and other machines.
Well, take a closer look, or find a different, millet log more than one error: should nothappen:no rect-based-test nodes found.
After Baidu, refer to the http://blog.csdn.net/rambomatrix/article/details/22503077 solution.
The original is because Viewpager in the switch page, fragment in the WebView did not monitor themselves in the visible state. So, when you find that WebView should be visible, let it move and tell WebKit to prepare for the response.
Then use the code to let WebView a little bit up and down.
Solve the problem of touch event not responding when Viewpager and ScrollView nested webview in MI system