Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23968] Android: problems in webview since 5.4.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-09-29T17:14:43.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsn/a
ReporterZakhar Zhuravlev
AssigneeHans Knöchel
Created2016-09-20T09:05:22.000+0000
Updated2016-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)

Comments

  1. Sharif AbuDarda 2016-09-21

    Hello, What version of Android device or simulator are you testing on? Give us details of the device model. Thanks.
  2. Zakhar Zhuravlev 2016-09-21

    Google Nexus I9250 with android 4.3. Xiaomi Redmi 3s with android 6.
  3. Gertjan Smits 2016-09-27

    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.
       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();
       
    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.
  4. Gertjan Smits 2016-09-27

    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();
  5. Sharif AbuDarda 2016-09-27

    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.
  6. Gertjan Smits 2016-09-28

    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:
       var win = Ti.UI.createWindow();
       win.add(Ti.UI.createWebView({url:'http://www.nu.nl/'}));
       win.open();
       
  7. Gertjan Smits 2016-09-28

    I found that this code was added in SDK 5.4.0.
       // TiUIWebView.java
       if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
       	webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
       }
       
    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 <= ?
  8. Gertjan Smits 2016-09-28

    See also this commit: https://github.com/appcelerator/titanium_mobile/commit/c2407cdfd53ba4190ceae582d788b658bbc30dd7
  9. Gertjan Smits 2016-09-28

    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.
  10. Hans Knöchel 2016-09-29

    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!
  11. Lokesh Choudhary 2016-09-30

    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
  12. Be Rushton 2016-10-19

    Can we have this back ported to 5.X since 6.0 is still in beta...

JSON Source