{ "id": "119791", "key": "TIMOB-15268", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2018-04-17T18:43:07.000+0000", "created": "2013-09-11T14:33:26.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "boostrap", "listview", "proxy", "template" ], "versions": [], "issuelinks": [ { "id": "47377", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "115777", "key": "TIMOB-14176", "fields": { "summary": "Android ListView not properly handling templates property post-creation", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "47376", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "135980", "key": "TIMOB-17596", "fields": { "summary": "Android: ListView: add support for specifying templates post-creation as is possible on iOS", "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": "Low", "id": "4" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "32572", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "120880", "key": "TIMOB-15408", "fields": { "summary": "Android: TableView/ListView behaves incorrectly when ScrollableView inside TableView/ListView", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2018-04-17T18:43:07.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": "On iOS the proxy for each created ListView cell is generated on the Objective-C part when initiating the cell. It means that each reusable cell has its own proxies.\r\n\r\nOn Android it's different, the proxies are created on the JS side when creating the listview. This has 2 bad consequences:\r\n# You can't modify the templates property after creating the view\r\n# Each reusable cell share the same proxies.\r\n\r\nThe second part is the one bugging me the most. It's not a problem with the current UI widgets because each widget has a view attached to it and this is why the magic works. But in the future (in my case right now) you can imagine having proxies without views. My example is a shape module.\r\n\r\n# I have a ShapeViewProxy + ShapeView\r\n# In this ShapeViewProxy i can add ShapeProxies which are stored and drawn (Circle, rect …)\r\n\r\nTo have better performance I don't create a view per ShapeProxy, it's an abstract object.\r\n\r\nThe view works great but I can't make it work with the ListView. This is because the ShapeProxies are shared by all cells.\r\n\r\nLet's say I want to change a shape color in ListView, I can have it record the change with bindId and DataItem but as a same proxy is the same for all cells, I can't update the reused cell correctly\r\n\r\nIf the proxies where created in the getView method like the iOS counterpart i could do that. I dont think it would be that hard to implement, my only problem to implement it is that right now, on the Java side, i can't map \"Ti.UI.View\" to ti.modules.titanium.ui.proxies.ViewProxy and thus cant create the proxy on the Java side using the \"type\" property of the template.\r\n\r\ngenBoostrap.py seems to have that map, but i dont really see how generate that map on the Java side.\r\n\r\nWith some help I could implement that.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: ListView: Don't create template proxies on the JavaScript side", "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 SDK 3.2.0 master", "comment": { "comments": [ { "id": "271071", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi Martin Guillon,\n\nplease shortly you can say the expected behavior and the actual behavior and can attached some image view or code\n\nThanks, ", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-09-13T16:18:47.000+0000", "updated": "2013-09-13T16:18:47.000+0000" }, { "id": "271165", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Hi Motiur,\n\nThere is no really \"expected\" behavior. I am talking about what could be a wrong implementation of the listview items proxy management.\nOn ios, the proxy is created [upon cell creation|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIListView.m#L1086]\nIt means there is one proxy per reusable cell. Which is nice because it means that accessing the proxy itself (for animation or such) is foreseeable.\n\nOn android though the proxies are create [upon template set|https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/js/listview.js#L39] It means that all cells share the same proxies which is bad for future interactions!\n\nNo my main problem is not about implementing it another way, but it s how to translate the \"type\" property of a template into a Java class. For example \"Ti.UI.View\" into ti.modules.titanium.ui.proxies.ViewProxy. It s easy to do on JS side, harder on the Java side. \n\nWhat i mention is that inside genBoostrap.py we have the knowing of those mappings. Would be nice to have a HashMap in Java that gives that mapping. Then i can implement and share a fix", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-09-15T08:17:12.000+0000", "updated": "2013-09-15T08:17:12.000+0000" }, { "id": "275515", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Martin,\n\n Thanks for the feedback. We'll discuss this in the near future.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-17T21:11:44.000+0000", "updated": "2013-10-17T21:11:44.000+0000" }, { "id": "436951", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is working as intended.\r\n\r\nOn iOS, it's definitely *+not+* creating a proxy for every row in the ListView. It creates just over 1 screen's worth of proxy rows and when you scroll up/down far enough, those proxies will be re-used/recycled by other rows. So, any settings applied to a proxy that are not in the ListView item template will inadvertently be applied to other rows in the ListView. This is why we don't provide direct access to the proxy objects.\r\n\r\nMy point being is that this is not just an Android limitation. The same limitation exists on iOS as well.\r\nTitanium's ListView is designed to work via templates only to achieve high performance.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-04-17T18:42:54.000+0000", "updated": "2018-04-17T18:42:54.000+0000" } ], "maxResults": 15, "total": 15, "startAt": 0 } } }