{ "id": "99268", "key": "TIMOB-10458", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14157", "description": "Sprint 2012-20 API", "name": "Sprint 2012-20 API", "archived": true, "released": true, "releaseDate": "2012-10-08" }, { "id": "14272", "description": "2012 Sprint 20", "name": "2012 Sprint 20", "archived": true, "released": true, "releaseDate": "2012-10-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-04T22:20:28.000+0000", "created": "2012-08-15T14:11:43.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "api", "module_tableview", "qe-testadded" ], "versions": [ { "id": "13572", "description": "Release 2.1.1", "name": "Release 2.1.1", "archived": true, "released": true, "releaseDate": "2012-07-31" } ], "issuelinks": [], "assignee": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-07-16T12:08:31.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": "When creating table sections with header views and a label, the header views are not sorted in the correct order. When executing this code repeatedly, the order of the labels is likely to change. It seems like this bug only happens when one section has a large number of items (in this case, section D). This bug was tested on Android 4.04. On iOS 5.1, the order is correct.\r\n\r\nSteps to reproduce:\r\n1. Run the code below\r\n2. Scroll to the bottom\r\n3. Notice that the labels in the table section header views do not show up in the correct order / in the order they were added\r\n\r\n{code:js}\r\nvar SettingsRow = function(a){\r\n a = a || {};\r\n a.height = a.height || 44;\r\n a.backgroundColor = 'transparent';\r\n var label = Ti.UI.createLabel({text: a.title, color: 'white', left: 10, font: {fontSize: 18, fontWeight: 'normal'}});\r\n var row = Ti.UI.createTableViewRow(a);\r\n row.add(label);\r\n row.label = label;\r\n row.allowsSelection = false;\r\n return row;\r\n};\r\n\r\nvar SettingsTableViewSection = function(title) {\r\n var headerView = Ti.UI.createView({height: 25, width:Ti.UI.FILL, backgroundColor:'#292b2c'});\r\n var headerLabel = Ti.UI.createLabel({top: 3, left: 3, text:title, color:'white', color: '#cccccc', font:{fontWeight:'bold', fontSize:14}});\r\n headerView.add(headerLabel);\r\n return Ti.UI.createTableViewSection({headerView:headerView});\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar rowA1 = SettingsRow({title: 'Row A1'});\r\nvar rowA2 = SettingsRow({title: 'Row A2'});\r\nvar rowB1 = SettingsRow({title: 'Row B1'});\r\nvar rowB2 = SettingsRow({title: 'Row A2'});\r\nvar rowC1 = SettingsRow({title: 'Row C1'});\r\nvar rowC2 = SettingsRow({title: 'Row C2'});\r\nvar rowD1 = SettingsRow({title: 'Row D1'});\r\nvar rowD2 = SettingsRow({title: 'Row D2'});\r\nvar rowD3 = SettingsRow({title: 'Row D3'});\r\nvar rowD4 = SettingsRow({title: 'Row D4'});\r\nvar rowD5 = SettingsRow({title: 'Row D5'});\r\nvar rowD6 = SettingsRow({title: 'Row D6'});\r\nvar rowD7 = SettingsRow({title: 'Row D7'});\r\nvar rowD8 = SettingsRow({title: 'Row D8'});\r\nvar rowE1 = SettingsRow({title: 'Row E1'});\r\nvar rowE2 = SettingsRow({title: 'Row E2'});\r\n\r\nvar tableSections = [\r\n SettingsTableViewSection('Section A'),\r\n SettingsTableViewSection('Section B'),\r\n SettingsTableViewSection('Section C'),\r\n SettingsTableViewSection('Section D'),\r\n SettingsTableViewSection('Section E'),\r\n];\r\n\r\ntableSections[0].add(rowA1);\r\ntableSections[0].add(rowA2);\r\ntableSections[1].add(rowB1);\r\ntableSections[1].add(rowB2);\r\ntableSections[2].add(rowC1);\r\ntableSections[2].add(rowC2);\r\ntableSections[3].add(rowD1);\r\ntableSections[3].add(rowD2);\r\ntableSections[3].add(rowD3);\r\ntableSections[3].add(rowD4);\r\ntableSections[3].add(rowD5);\r\ntableSections[3].add(rowD6);\r\ntableSections[3].add(rowD7);\r\ntableSections[3].add(rowD8);\r\ntableSections[4].add(rowE1);\r\ntableSections[4].add(rowE2);\r\n\r\nvar table = Ti.UI.createTableView({top: 0,backgroundColor:'#000'});\r\n\r\ntable.setData(tableSections);\r\n\r\nwin.add(table);\r\n\r\nwin.open();\r\n{code}\r\n\r\n\r\nThe following example has less rows in section D, the order of the header views is correct:\r\n{code:js}\r\nvar SettingsRow = function(a){\r\n a = a || {};\r\n a.height = a.height || 44;\r\n a.backgroundColor = 'transparent';\r\n var label = Ti.UI.createLabel({text: a.title, color: 'white', left: 10, font: {fontSize: 18, fontWeight: 'normal'}});\r\n var row = Ti.UI.createTableViewRow(a);\r\n row.add(label);\r\n row.label = label;\r\n row.allowsSelection = false;\r\n return row;\r\n};\r\n\r\nvar SettingsTableViewSection = function(title) {\r\n var headerView = Ti.UI.createView({height: 25, width:Ti.UI.FILL, backgroundColor:'#292b2c'});\r\n var headerLabel = Ti.UI.createLabel({top: 3, left: 3, text:title, color:'white', color: '#cccccc', font:{fontWeight:'bold', fontSize:14}});\r\n headerView.add(headerLabel);\r\n return Ti.UI.createTableViewSection({headerView:headerView});\r\n}\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar rowA1 = SettingsRow({title: 'Row A1'});\r\nvar rowA2 = SettingsRow({title: 'Row A2'});\r\nvar rowB1 = SettingsRow({title: 'Row B1'});\r\nvar rowB2 = SettingsRow({title: 'Row A2'});\r\nvar rowC1 = SettingsRow({title: 'Row C1'});\r\nvar rowC2 = SettingsRow({title: 'Row C2'});\r\nvar rowD1 = SettingsRow({title: 'Row D1'});\r\nvar rowD2 = SettingsRow({title: 'Row D2'});\r\nvar rowE1 = SettingsRow({title: 'Row E1'});\r\nvar rowE2 = SettingsRow({title: 'Row E2'});\r\n\r\nvar tableSections = [\r\n SettingsTableViewSection('Section A'),\r\n SettingsTableViewSection('Section B'),\r\n SettingsTableViewSection('Section C'),\r\n SettingsTableViewSection('Section D'),\r\n SettingsTableViewSection('Section E'),\r\n];\r\n\r\ntableSections[0].add(rowA1);\r\ntableSections[0].add(rowA2);\r\ntableSections[1].add(rowB1);\r\ntableSections[1].add(rowB2);\r\ntableSections[2].add(rowC1);\r\ntableSections[2].add(rowC2);\r\ntableSections[3].add(rowD1);\r\ntableSections[3].add(rowD2);\r\ntableSections[4].add(rowE1);\r\ntableSections[4].add(rowE2);\r\n\r\nvar table = Ti.UI.createTableView({top: 0,backgroundColor:'#000'});\r\n\r\ntable.setData(tableSections);\r\n\r\nwin.add(table);\r\n\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: TableSection - header views are not sorted correctly", "creator": { "name": "haagendazs", "key": "haagendazs", "displayName": "Daniel Hanold", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK V2.1.1.GA\r\nSamsung Galaxy S3\r\nAndroid 4.0.4", "closedSprints": [ { "id": 3, "state": "closed", "name": "Release 3.0.0", "startDate": "2012-09-27T05:26:46.636Z", "endDate": "2012-10-08T20:05:00.000Z", "completeDate": "2012-12-20T17:03:19.403Z" } ], "comment": { "comments": [ { "id": "218302", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you elaborate on the buggy behavior? Maybe provide a couple screenshots to differentiate between iOS and Android. I tried this on latest master and can't repro this. All the rows are in correct order.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-10T17:14:01.000+0000", "updated": "2012-09-10T17:14:01.000+0000" }, { "id": "218682", "author": { "name": "haagendazs", "key": "haagendazs", "displayName": "Daniel Hanold", "active": true, "timeZone": "America/New_York" }, "body": "This behavior is still happening for me using the latest SDK. Here is my testing environment on Android:\r\nTiSDK V2.1.2.GA\r\nSamsung Galaxy S3\r\nAndroid 4.0.4\r\n\r\nSee attached iOS screenshots and Android screenshots. On iOS, the sections are in the correct order. On Android, they are not. This was tested with the code list in the initial comment.\r\nScreenshot iOS: http://cl.ly/image/0z3X0f3g2Q2Q\r\nScreenshot Android: http://cl.ly/image/182v1E112b0a", "updateAuthor": { "name": "haagendazs", "key": "haagendazs", "displayName": "Daniel Hanold", "active": true, "timeZone": "America/New_York" }, "created": "2012-09-12T12:21:35.000+0000", "updated": "2012-09-12T12:21:35.000+0000" }, { "id": "220274", "author": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\r\nPull request https://github.com/appcelerator/titanium_mobile/pull/3033", "updateAuthor": { "name": "krowley", "key": "krowley", "displayName": "Karl Rowley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-22T16:57:43.000+0000", "updated": "2012-09-22T18:07:40.000+0000" }, { "id": "223897", "author": { "name": "janhelleman", "key": "janhelleman", "displayName": "Jan Helleman", "active": true, "timeZone": "Europe/Berlin" }, "body": "The issue remains on the 2.1.xxxx branch, at least at android 2.2. Even in the current 3.1.0.v20121016132513 this does not work on android 2.2. It works on the 3.0 branch.", "updateAuthor": { "name": "janhelleman", "key": "janhelleman", "displayName": "Jan Helleman", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-10-16T22:34:06.000+0000", "updated": "2012-10-16T22:41:25.000+0000" }, { "id": "225038", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For testing, please use the first test case above. There should be a table view with enough rows to trigger scrolling. If there aren't enough rows, please add more rows so it scrolls.\n\nScroll up and down, and you will notice the header views change in the fail case. With the PR, the headers should stay consistent and be sorted.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T01:54:37.000+0000", "updated": "2012-10-26T01:54:37.000+0000" }, { "id": "225230", "author": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as fixed. Tested and verified on:\r\nTitanium Studio, build: 3.0.0.201210220122\r\nTitanium SDK, build: 3.0.0.v20121025171611\r\nDevice: Galaxy Nexus (4.1.1)", "updateAuthor": { "name": "tsmolich", "key": "tsmolich", "displayName": "Tamila Smolich", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-26T23:32:21.000+0000", "updated": "2012-10-26T23:32:21.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }