[TIMOB-23968] Android: problems in webview since 5.4.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-29T17:14:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | Android |
Labels | n/a |
Reporter | Zakhar Zhuravlev |
Assignee | Hans Knöchel |
Created | 2016-09-20T09:05:22.000+0000 |
Updated | 2016-10-19T02:46:05.000+0000 |
Description
Our app shows 3D tours of flats/houses.
Next example is working fine on 5.3.0, but something was broken in 5.4.0 version of SDK, I don't understand what exactly! I don't see in release notes some specific stuff related to webview component. Please, shed some light on this issue. Any help/advice appreciated.
*index.js:*
var webview = Ti.UI.createWebView({
url: "https://360-sandbox.immoviewer.com/tour/show/1029649?accessKey=5712"
});
var webviewfragment = require('de.marcelpociot.webviewfragment');
var webViewHolder = webviewfragment.createWebview({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
centerWindow: webview
});
$.win.add(webViewHolder);
$.win.open();
P.S. I'm using this module: https://github.com/mpociot/TiWebviewFragment
Because of webview doesn't work correctly by default.
P.P.S. issue: since 5.4.0 webview loads fine, but I don't see panorama (only gray screen)
Hello, What version of Android device or simulator are you testing on? Give us details of the device model. Thanks.
Google Nexus I9250 with android 4.3. Xiaomi Redmi 3s with android 6.
I'm not sure if my issue is related but we've noticed the performance of the WebView is really bad (in 5.4.0.GA & 5.5.0.GA). Especially the scrolling is very laggy. The following is enough to reproduce it. Opening the same url in the native browser scrolls fine.
Tested on a LG G3 (5.0), Samsung S7 Edge (6.0.2), Nexus 5 (5.0.1). It seems like the better the device is, the worse the performance is. We can not go back to an older SDK so we are kind of in trouble at this point as we have to submit 2 apps this week.
I don't know what happens to my code snippet, it's all indented wrong, here is the code without the formatting: var win = Ti.UI.createWindow({ title:'WebView pret', backgroundColor:'#fff' }); var webView = Ti.UI.createWebView({ url:'http://www.nu.nl/', width:Ti.UI.FILL, height:Ti.UI.FILL }); win.add(webView); win.open();
Hello, I am using SDK 5.5.0.GA. The sample code you have provided I have tested on device running Android 6 and also in simulator. Webview seems to work fine for my test. Also the scrolling workd fine. The device you have mentioned "Google Nexus I9250 with android 4.3 and Xiaomi Redmi 3s with android 6." these devices are not available here. Possibly the issue is worh the device. It would be helpful if you provide a video sample demonstrating the issue. Thanks.
I made the video, you can see it here: https://youtu.be/1sDVtweBNus The video is done with a Samsung Galaxy S7 Edge, the first section is a website in the Google Chrome browser, the next in the Titanium test app built with SDK 5.4.0.GA. Reduced the test code to:
I found that this code was added in SDK 5.4.0.
This was not there in 5.3.0, which works fine. This in the only change in TiUIWebView.java. I'm not sure why that is added, didn't they mean <= ?
See also this commit: https://github.com/appcelerator/titanium_mobile/commit/c2407cdfd53ba4190ceae582d788b658bbc30dd7
I can confirm removing the
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
works. I've created a patched version of SDK 5.4.1 which scrolls as expected.I reverted the commit for now. It was merged to quickly and did not run through the QE-process. Sorry for that! Until we have a better solution to configure the layer-type dynamically, this change should not be included. Thanks for reporting!
Verified the fix. The webview scrolls smoothly after the fix. Closing. Environment: Appc Studio : 4.8.0.201609292239 Ti SDK : 6.0.0.v20160929101355 Ti CLI : 5.0.10 Alloy : 1.9.2 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-7 Appc CLI : 6.0.0-48 Node: 4.4.4 Nexus 5 - Android 6.0.1
Can we have this back ported to 5.X since 6.0 is still in beta...