{ "id": "175909", "key": "AC-6646", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": null, "resolutiondate": null, "created": "2020-12-15T08:43:17.000+0000", "labels": [ "android", "parity" ], "versions": [], "issuelinks": [], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-12-15T10:23:56.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "If `currentPage` property of scrollable view is assigned in the code, the value doesn't seem to get updated immediately on Android. This issue can be reproduced by creating a new project with the following sample code, building the project with Titanium SDK 9.3.0.GA, and running the app on an *_Android_* device:\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar v0 = Ti.UI.createView({\r\n backgroundColor: 'red'\r\n});\r\nv0.add(Ti.UI.createLabel({\r\n color: 'white',\r\n text: 'Page index = 0'\r\n}));\r\n\r\nvar v1 = Ti.UI.createView({\r\n backgroundColor: 'blue'\r\n});\r\nv1.add(Ti.UI.createLabel({\r\n color: 'white',\r\n text: 'Page index = 1'\r\n}));\r\n\r\nvar v2 = Ti.UI.createView({\r\n backgroundColor: 'green'\r\n});\r\nv2.add(Ti.UI.createLabel({\r\n color: 'white',\r\n text: 'Page index = 2'\r\n}));\r\n\r\nvar scrollableView = Ti.UI.createScrollableView({\r\n views: [v0, v1, v2],\r\n height: Ti.UI.FILL,\r\n width: Ti.UI.FILL\r\n});\r\nwin.add(scrollableView);\r\n\r\n// Note that `currentPage` property of scrollable view is assigned here\r\nscrollableView.currentPage = 1;\r\n\r\nTi.API.info('`currentPage` property of scrollable view is: ' + scrollableView.currentPage);\r\n\r\nwin.open();\r\n{code}\r\n\r\nWhat I observed in the console was a message saying \"[INFO] `currentPage` property of scrollable view is: 0\", but `currentPage` should have been updated to 1 already.\r\n\r\nFYI, when I run the above sample code on an iOS device, the console output would be \"[INFO] `currentPage` property of scrollable view is: 1\" instead, which was the expected behaviour.\r\n", "attachment": [], "flagged": false, "summary": "[Android] Scrollable View `currentPage` Property Not Updated After Being Assigned", "creator": { "name": "mwenli", "key": "mwenli", "displayName": "Ma Wenli", "active": true, "timeZone": "Asia/Hong_Kong" }, "subtasks": [], "reporter": { "name": "mwenli", "key": "mwenli", "displayName": "Ma Wenli", "active": true, "timeZone": "Asia/Hong_Kong" }, "environment": "Titanium SDK: 9.3.0.GA (macOS version)\r\nPlatform: Android", "comment": { "comments": [ { "id": "457891", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "I can reproduce this issue back to 8.3.1.GA, it's possible this might be some form of timing issue on Android as adding even a small timeout to the log like below will log the correct value\r\n\r\n{code}\r\nsetTimeout(() => {\r\n Ti.API.info('`currentPage` property of scrollable view is after timeout: ' + scrollableView.currentPage);\r\n}, 50)\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-12-15T10:23:56.000+0000", "updated": "2020-12-15T10:23:56.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }