{ "id": "174521", "key": "TIMOB-27697", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-08-03T15:06:33.000+0000", "created": "2019-12-09T14:45:07.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "event", "parity", "progress", "webview" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-08-03T15:06:39.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "For some reason the progress event in Ti.UI.WebView is only available for iOS, so I did an attempt to add it (disclaimer: I am not a java programmer)\r\n\r\nAdding this function to TiWebChromeClient.java seems to fix it;\r\n\r\n{code:java}\r\n\tpublic void onProgressChanged(WebView view, int progress)\r\n\t{\r\n\t\tWebViewProxy proxy = (WebViewProxy) tiWebView.getProxy();\r\n\t\tif (proxy != null) {\r\n\t\t\tKrollDict data = new KrollDict();\r\n\t\t\tdata.put(\"progress\", progress);\r\n\t\t\tproxy.fireEvent(\"progress\", data);\r\n\t\t}\r\n\t}\r\n{code}\r\n\r\nI tested it on SDK 8.3.0 and 9.0.0. Both tests successful.\r\n\r\nEDIT: created a PR: https://github.com/appcelerator/titanium_mobile/pull/11383\r\n", "attachment": [], "flagged": false, "summary": "Add \"progress\" event to Ti.UI.WebView for Android (parity)", "creator": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": null, "closedSprints": [ { "id": 1192, "state": "closed", "name": "2020 Sprint 8", "startDate": "2020-04-10T18:08:36.092Z", "endDate": "2020-04-24T18:08:00.000Z", "completeDate": "2020-04-24T16:23:30.466Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "453286", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~arif] Thanks for your ticket and PR. I have escalated this to our engineering team. This needs to pass Product approval and then engineering will decide when to include this into our SDK.\r\n\r\nWe appreciate your help.", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-23T12:51:10.000+0000", "updated": "2019-12-23T12:51:10.000+0000" }, { "id": "455023", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, waiting on Jenkins build", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-08T15:20:29.000+0000", "updated": "2020-04-08T15:20:29.000+0000" }, { "id": "455232", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.1.0 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-04-24T13:50:03.000+0000", "updated": "2020-04-24T13:50:03.000+0000" }, { "id": "456291", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening ticket, Console now shows {{[INFO] \b\b \b undefined}} when tracking the progress event on SDK versions {{9.1.0.v20200724110711}}, {{9.2.0.v20200724112452}} and {{9.3.0.v20200724114100}}.\r\n\r\n*Test case:*\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow();\r\nvar webview = Ti.UI.createWebView({\r\n url: 'http://www.google.com'\r\n});\r\nwebview.addEventListener('progress', function(e) {\r\n Ti.API.info(e.progress);\r\n});\r\nwin.add(webview);\r\nwin.open();\r\n\r\n{code}\r\n\r\nTest Environment*\r\n{code:java}\r\nMacOS Big Sur: 11.0 Beta\r\nXcode: 12.0 Beta \r\nJava Version: 1.8.0_242\r\nAndroid NDK: 21.3.6528147\r\nNode.js: 12.18.1\r\n\"\"NPM\":\"5.0.0\",\"CLI\":\"8.1.0-master.5\"\"\r\nAPI29 Pixel XL emulator\r\n{code}\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-30T13:26:38.000+0000", "updated": "2020-07-30T13:28:01.000+0000" }, { "id": "456293", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~smohammed], the event does not have a \"progress\" property. That's why it returns undefined.\r\nhttps://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-event-progress\r\n\r\nI think you mean to do this?\r\n{code:javascript}\r\nwebview.addEventListener('progress', function(e) {\r\n\tTi.API.info(\"WebView Progress: \" + e.value);\r\n});\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-07-30T16:02:50.000+0000", "updated": "2020-07-30T16:02:50.000+0000" }, { "id": "456325", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ah yeah sorry my bad testing with the code above everything looks good on 9.1.0.v20200724110711, 9.2.0.v20200724112452 and 9.3.0.v20200724114100, thanks. ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-03T15:06:24.000+0000", "updated": "2020-08-03T15:06:24.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }