{ "id": "121818", "key": "TIMOB-15780", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-09T21:30:16.000+0000", "created": "2013-10-30T14:49:34.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "events", "module_scrollableview", "qe-closed-3.3.0", "qe-testadded", "scrollableView", "triage" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "56243", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "139381", "key": "TIMOB-18413", "fields": { "summary": "Android: ScrollableView crash", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-26T18:26:42.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": "The setCurrentPage method for Ti.UI.ScrollableView fires the 'dragend' & 'scrollend' events upon completion.\r\n\r\nAccording to the docs:\r\n\r\nscrollend: Fired when the view has stopped moving completely.\r\ndragend: Fired when the scrolling drag gesture on the view has been completed.\r\n\r\nIf setCurrentPage is called programmatically, the 'dragend' event is incorrect as no drag gesture has been occurred.\r\n\r\nIf setCurrentPage is called programmatically and without animation, the 'scrollend' event is incorrect as no movement has occurred.", "attachment": [ { "id": "65131", "filename": "ScrollableViewAddRemoveTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-04T00:21:34.000+0000", "size": 3657, "mimeType": "application/x-javascript" } ], "flagged": false, "summary": "Android: ScrollableView.setCurrentPage() fires \"scrollend\" event when it shouldn't", "creator": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "environment": "Titanium SDK: 3.1.3.GA\r\nOS: CrunchBang 11 Waldorf\r\nDeployment: Android\r\n", "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 }, { "id": 126, "state": "closed", "name": "2018 Sprint 05 SDK", "startDate": "2018-02-25T19:38:08.926Z", "endDate": "2018-03-11T18:38:00.000Z", "completeDate": "2018-03-11T22:06:01.520Z", "originBoardId": 100 } ], "comment": { "comments": [ { "id": "277461", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi Lee Driscoll,\r\n\r\nCould you share full test case so that i paste into the app.js file and can check it.\r\n\r\nThanks", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-10-31T04:51:01.000+0000", "updated": "2013-11-01T05:14:19.000+0000" }, { "id": "277673", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "when you say app.js I'm assuming you're talking about the index.js file? \nSorry, I've only worked on alloy projects.\n\n{code:javascript}\n\nvar primaryView = $.getView();\n\n//assuming primary view is a window\n\nvar scrollableView = Ti.UI.createScrollableView({\n views: [\n Ti.UI.createView(),\n Ti.UI.createView()\n ]\n});\n\nprimaryView.add(scrollableView);\n\nscrollableView.addEventListener('dragend', callback);\nscrollableView.addEventListener('scrollend', callback);\n\nprimaryView.open();\n\nscrollableView.setCurrentPage(1);\n\nfunction callback(e){\n Ti.API.info('Event [' + e.type + '] fired );\n}\n\n{code}", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-01T14:35:09.000+0000", "updated": "2013-11-01T14:35:09.000+0000" }, { "id": "278439", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2013-11-06T16:53:22.000+0000", "updated": "2013-11-06T16:53:22.000+0000" }, { "id": "281452", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tested on simple commonjs app and the event does not fire; works as expected:\n\n{code}\nvar win = Titanium.UI.createWindow();\n\nvar scrollableView = Ti.UI.createScrollableView({\n\tbottom: 40,\n views: [\n Ti.UI.createView({\n \tbackgroundColor: 'green'\n }),\n Ti.UI.createView({\n\t\tbackgroundColor: 'blue'\n })\n ]\n});\nwin.add(scrollableView);\nwin.add(btn);\n\nvar btn = Ti.UI.createButton({\n\tbottom: 0,\n\theight: 40,\n\ttitle: 'scroll'\n});\n \nscrollableView.addEventListener('dragend', callback);\nscrollableView.addEventListener('scrollend', callback);\n \n \nbtn.addEventListener('click', function(){\n\tscrollableView.setCurrentPage(1);\n});\n \nfunction callback(e){\n alert('Event [' + e.type + '] fired');\n}\n\nwin.open();\n{code}", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-26T18:12:51.000+0000", "updated": "2013-11-26T18:12:51.000+0000" }, { "id": "281455", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Discard last comment, I was testing on iPhone. Tested on Android and was able to reproduce it.", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-26T18:19:50.000+0000", "updated": "2013-11-26T18:19:50.000+0000" }, { "id": "281491", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR pending: https://github.com/appcelerator/titanium_mobile/pull/5031", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-26T19:44:11.000+0000", "updated": "2013-11-26T19:44:11.000+0000" }, { "id": "301257", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-04-17T17:09:42.000+0000", "updated": "2014-04-17T17:09:42.000+0000" }, { "id": "302335", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified with test environment:\r\n\r\nAppc-Studio:3.3.0.201404211130\r\nsdk:3.3.0.v20140423155715\r\nacs:1.0.14\r\nalloy:1.4.0-dev\r\nnpm:1.3.2\r\ntitanium:3.3.0-dev\r\ntitanium-code-processor:1.1.1-beta1\r\nxCODE:5.1.1\r\nDevice:Iphone5(7.1),LG-P970(v4.0.4)\r\n\r\nsetCurrentPage() Method for scrollable View working fine.", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-04-24T05:50:11.000+0000", "updated": "2014-04-24T05:50:11.000+0000" }, { "id": "432655", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-opening since this issue has not been resolved on Android.\r\nThe \"scrollend\" event still gets fired when calling setCurrentPage().\r\nThe \"dragend\" event does not get fired. (This is good.)\r\n\r\nI was able to reproduce the above in Titanium 6.0.2 and 7.0.1.\r\n\r\n*Test Code:*\r\n{code:javascript}\r\nvar pageNumber = 0;\r\nfunction createPage() {\r\n\tpageNumber++;\r\n\treturn Ti.UI.createLabel(\r\n\t{\r\n\t\ttext: \"Page \" + pageNumber,\r\n\t\ttextAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,\r\n\t\tcolor: \"black\",\r\n\t\tbackgroundColor: \"white\",\r\n\t\tleft: \"1dp\",\r\n\t\tright: \"1dp\",\r\n\t\twidth: Ti.UI.FILL,\r\n\t\theight: Ti.UI.FILL,\r\n\t});\r\n}\r\nvar window = Ti.UI.createWindow();\r\nvar scrollableView = Ti.UI.createScrollableView(\r\n{\r\n\tviews:\r\n\t[\r\n\t\tcreatePage(),\r\n\t\tcreatePage(),\r\n\t\tcreatePage(),\r\n\t\tcreatePage(),\r\n\t],\r\n\tshowPagingControl: true,\r\n\tbackgroundColor: \"black\",\r\n});\r\nscrollableView.addEventListener(\"scroll\", function(e) {\r\n\tTi.API.info(\"@@@ [scroll] currentPage: \" + e.currentPage + \", currentPageAsFloat: \" + e.currentPageAsFloat);\r\n});\r\nscrollableView.addEventListener(\"scrollend\", function(e) {\r\n\tTi.API.info(\"@@@ [scrollend] Current page index: \" + e.currentPage);\r\n});\r\nscrollableView.addEventListener(\"dragstart\", function(e) {\r\n\tTi.API.info(\"@@@ [dragstart]\");\r\n});\r\nscrollableView.addEventListener(\"dragend\", function(e) {\r\n\tTi.API.info(\"@@@ [dragend] currentPage: \" + e.currentPage);\r\n});\r\nwindow.add(scrollableView);\r\nwindow.open();\r\n\r\nvar isAnimated = false;\r\nsetInterval(function() {\r\n\tvar pages = scrollableView.views;\r\n\tif (pages && (pages.length > 0)) {\r\n\t\tif (isAnimated) {\r\n\t\t\tif (((scrollableView.currentPage + 1) % pages.length) > 0) {\r\n\t\t\t\tscrollableView.moveNext();\r\n\t\t\t} else {\r\n\t\t\t\tscrollableView.scrollToView(0);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar nextPageIndex = (scrollableView.currentPage + 1) % pages.length;\r\n\t\t\tscrollableView.currentPage = nextPageIndex;\r\n\t\t}\r\n\t}\r\n}, 1500);\r\n{code}\r\n\r\n*Side Note:*\r\nBoth Android and iOS fire a single \"scroll\" event after calling setCurrentPage(). I don't agree with this behavior, but at least the 2 platforms are consistent.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-03T04:20:13.000+0000", "updated": "2018-01-05T02:41:43.000+0000" }, { "id": "432800", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-06T02:46:58.000+0000", "updated": "2018-01-06T02:46:58.000+0000" }, { "id": "437400", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting for merger to be enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-05T01:11:13.000+0000", "updated": "2018-05-05T01:11:13.000+0000" }, { "id": "437541", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-09T21:30:08.000+0000", "updated": "2018-05-09T21:30:08.000+0000" }, { "id": "438731", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "*Closing ticket.*\r\nThe fix is present in SDK:\r\n\r\n{noformat}\r\n7.3.0.v20180626064422\r\n{noformat}", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2018-06-26T18:26:34.000+0000", "updated": "2018-06-26T18:26:34.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }