{ "id": "93012", "key": "TIMOB-9474", "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": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13408", "description": "Sprint 2012-12 API", "name": "Sprint 2012-12 API", "archived": true, "released": true, "releaseDate": "2012-06-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-06-08T17:41:45.000+0000", "created": "2012-06-08T15:11:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "regression" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-06-18T15:37:10.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": "Trying to use scrollToView() on a ScrollableView sometimes results in an exception being thrown.\r\nThis appears to be triggered by creating the ScrollableView and passing a \"currentPage\" parameter.\r\n\r\nThis regression appears in the KS Base UI > Views > Scroll Views > Scrollable View.\r\nTry scrolling to the next view by using the arrows on the bottom (these call scrollToView()).\r\n\r\nh3. Standalone test case\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({layout: 'vertical'});\r\n\r\nvar views = ['blue', 'red', 'yellow'].map(function(color) {\r\n\treturn Ti.UI.createView({backgroundColor: color});\r\n});\r\n\r\nvar scrollable = Ti.UI.createScrollableView({\r\n\theight: '80%',\r\n\tcurrentPage: 1,\r\n\tviews: views\r\n});\r\nwin.add(scrollable);\r\n\r\nvar controls = Ti.UI.createView({\r\n\theight: '20%'\r\n});\r\nwin.add(controls);\r\n\r\nvar currentView = 1;\r\n\r\nvar prevButton = Ti.UI.createButton({\r\n\ttitle: \"Prev\",\r\n\tleft: 10,\r\n\twidth: 200\r\n});\r\ncontrols.add(prevButton);\r\nprevButton.addEventListener('click', function() {\r\n\tif (currentView === 0) return;\r\n\tscrollable.scrollToView(--currentView);\r\n});\r\n\r\nvar nextButton = Ti.UI.createButton({\r\n\ttitle: \"Next\",\r\n\tright: 10,\r\n\twidth: 200\r\n});\r\ncontrols.add(nextButton);\r\nnextButton.addEventListener('click', function() {\r\n\tif (currentView == (scrollable.views.length - 1)) return;\r\n\tvar view = scrollable.views[++currentView];\r\n\tscrollable.scrollToView(view);\r\n});\r\n\r\nscrollable.addEventListener('scroll', function(e) {\r\n\tcurrentView = e.currentPage;\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nRun the test case and try switching views by using the \"next\" or \"prev\" buttons.\r\n\r\nExpected: Views change without any crash.", "attachment": [], "flagged": false, "summary": "Android: ScrollableView throws exception when using scrollToView()", "creator": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "197932", "author": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Sent [PR #2364|https://github.com/appcelerator/titanium_mobile/pull/2364] to fix regression.", "updateAuthor": { "name": "joshroesslein", "key": "joshroesslein", "displayName": "Josh Roesslein", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-08T16:14:49.000+0000", "updated": "2012-06-08T16:14:49.000+0000" }, { "id": "198995", "author": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue\r\n\r\nTested with Ti Studio build 2.1.0.201206172244\r\nTi Mobile SDK2.1.0.v20120618134156 hash r00905cd0\r\nOSX Lion 10.7.3\r\nNexus S OS 4.0.4\r\n\r\nThe expected behavior is shown", "updateAuthor": { "name": "mpettiford", "key": "mpettiford", "displayName": "Michael Pettiford", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-06-18T15:37:10.000+0000", "updated": "2012-06-18T15:37:10.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }