{ "id": "104314", "key": "ALOY-359", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [ { "id": "14770", "description": "Alloy 0.3.4", "name": "Alloy 0.3.4", "archived": false, "released": true, "releaseDate": "2012-12-14" }, { "id": "14773", "description": "2012 Sprint 24", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-12-07T22:30:33.000+0000", "created": "2012-11-02T14:58:31.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-07T22:25:35.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "12333", "name": "Widgets" } ], "description": "We're using the built in widget \"ButtonGrid\" (which is documented very well btw). Everything works fine but I wanted to point out a potential issue with using the orientationchange global event: https://github.com/appcelerator/alloy/blob/master/widgets/com.appcelerator.buttongrid/controllers/widget.js#L167\r\n\r\nWhile this is innocent if the developer only plans on having one instance of the buttongrid that's always in memory, imagine if there are multiple instances that are meant to go out of scope. The user would have created a memory leak if he hadn't looked at the source code, realized this was there, and manually removed the event.\r\n\r\nThree possible options:\r\n1. Remove it completely and let the user assign an orientation event to the Widget.relayout() method on his own.\r\n\r\n2. Have some type of remove method that will remove it for the user\r\n\r\n3. Document that the user must remove it manually.\r\n\r\nI prefer #1.", "attachment": [], "flagged": false, "summary": "buttongrid Widget and orientation change", "creator": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "rblalock", "key": "rblalock", "displayName": "Rick Blalock", "active": false, "timeZone": "America/Havana" }, "environment": null, "comment": { "comments": [ { "id": "230452", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think I'm going to do a little bit of a mix of #1 and #2. I'm going to add a configuration option to the init() called *autoLayout*, which will be *true* by default to maintain compatibility with any existing uses of this widget. If *autoLayout* is set to true, then the developer will be required to free the gesture handler manually with a new destroy() function. If *autoLayout* is set to false, the gesture handler will not be created automatically, but the developer will need to handle orientation changes themselves if they so choose.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T22:01:39.000+0000", "updated": "2012-12-07T22:01:39.000+0000" }, { "id": "230463", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Latest inline docs for the buttongrid widget can be found here: https://github.com/appcelerator/alloy/blob/master/widgets/com.appcelerator.buttongrid/controllers/widget.js\r\n\r\nThey detail the use of the new *autoLayout* property and *destroy()* function.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T22:30:33.000+0000", "updated": "2012-12-07T22:30:33.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }