{ "id": "98049", "key": "AC-3185", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2012-07-29T17:11:35.000+0000", "created": "2012-07-26T06:09:49.000+0000", "labels": [ "android", "ios", "reuse", "tableview" ], "versions": [], "issuelinks": [], "assignee": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "updated": "2016-03-08T07:57:35.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "The firs and most important thing is an optimisation of scrolling on android. the getView() method is called many times on the same row, and every-time the setRowData was called (which is really heavy).\r\nSo i changed it to only call setRowData when the data actually changed.\r\n\r\nI also added \"reuse\" and \"rowappear\" events in the tableview. This allows huge improvements in tableview loading and scrolling. For exemple if you download async images, you can start the download only when the row appears and stop it on reuse. Also you can \"create\" the row content only on \"rowappear\".\r\nWhen you have a lot of complex rows it can drastically improve table loading. So the idea is that you create the rowData only with empty rows. Then on \"rowappear\" you create your custom view and add it to the row.\r\nIt works amazingly well. I still have to figure out why on android when loading the tableview, displayed cells first appear empty then fill themselves.\r\nI add to fire the \"reuse\" event on the row itself, because of the ios implementation.\r\nThe \"rowappear\" event is fired on the tableview\r\n\r\nTestCase\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: 'white'\r\n});\r\n\r\nvar tableview = Ti.UI.createTableView();\r\ntableview.addEventListener('rowappear', function(_event){\r\n Ti.API.info('rowappear at index' + _event.index);\r\n});\r\nvar rowData = [];\r\nfor (var i=0; i < 300; i++) {\r\n var row = Ti.UI.createTableViewRow({\r\n title: ('row ' + i)\r\n });\r\n row.addEventListener('reuse', function(_event){\r\n Ti.API.info('reuse row at index' + _event.index);\r\n });\r\n rowData.push(row);\r\n}\r\ntableview.data = rowData;\r\nwin.add(tableview);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "[tableview] added 'reuse', 'willappear' events. improve scrolling on android", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Titanium 2.2.0 (master)\r\nios 5.1\r\nandroid 3.2", "comment": { "comments": [ { "id": "209534", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "pull request https://github.com/appcelerator/titanium_mobile/pull/2515", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-07-26T06:10:01.000+0000", "updated": "2012-07-26T06:10:01.000+0000" }, { "id": "209774", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Hi Martin,\r\n\r\nThanks for the pull request. Just one thing, could you please create a new JIRA ticket with the same pull request against the master branch as platform is not able to merge it in the 2.1.X branch.\r\n\r\nFor your reference, here is the link that explains how to contribute code to Titanium (if you dont already have it) : \r\n\r\nhttps://wiki.appcelerator.org/display/guides2/Contributing+to+Titanium\r\n\r\nPlease close this ticket after you create the other one.\r\n\r\nRegards,\r\nVarun", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-07-26T14:24:44.000+0000", "updated": "2012-07-26T14:24:44.000+0000" }, { "id": "210367", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Yes you are right. Also i am still working on this one . I am so sure about events for that as they are async, I am thinking about using a method like HTTPClient onload.\r\nWill create a new ticket\r\n\r\nThanks", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-07-28T03:37:41.000+0000", "updated": "2012-07-28T03:37:41.000+0000" }, { "id": "210381", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Thanks. Closing this ticket.", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-07-29T17:11:20.000+0000", "updated": "2012-07-29T17:11:20.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }