{ "id": "150632", "key": "TIMOB-19394", "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": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-11-12T04:40:31.000+0000", "created": "2015-08-23T08:47:56.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "issuelinks": [ { "id": "48960", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "151105", "key": "TIDOC-2304", "fields": { "summary": "Docs: Ti.UI.View.add supports an array of views as well as single Ti.Ui.View", "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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } }, { "id": "48926", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "151050", "key": "TIMOB-19482", "fields": { "summary": "Parity: Ti.UI.View.add should support array of views on Android as 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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-11-17T01:15:03.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "On iOS {{Ti.UI.View.add()}} accepts an array of views:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/0357b4796abf0032485018fac42614a94f826c9b/iphone/Classes/TiViewProxy.m#L148\r\n\r\nOn Android it does not:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/titanium/src/java/org/appcelerator/titanium/view/TiUIView.java#L159\r\n\r\nThis is a very useful feature and looking at the iOS code simple to implement for Android and Windows as well.\r\n\r\nRelated question on Q&A:\r\nhttps://community.appcelerator.com/topic/3075/unable-to-add-array-of-views-to-parent-view-on-android", "attachment": [], "flagged": false, "summary": "Parity: Ti.UI.View.add should support array of views on Windows as iOS", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 4.1.0.GA", "closedSprints": [ { "id": 484, "state": "closed", "name": "2015 Sprint 18 Windows", "startDate": "2015-08-30T04:01:00.000Z", "endDate": "2015-09-12T03:59:00.000Z", "completeDate": "2015-09-14T17:29:28.792Z", "originBoardId": 144 }, { "id": 525, "state": "closed", "name": "2015 Sprint 23 SDK", "startDate": "2015-11-07T01:30:15.519Z", "endDate": "2015-11-21T01:30:00.000Z", "completeDate": "2015-11-23T02:54:27.887Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "362661", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "It's not too hard to do this for Windows, but I should note that the iOS version also supports using an object to specify the view and the position to insert it. Both the array and the single/array of objects with a \"view\" and \"position\" key are undocumented.\r\n\r\nDo we fix the docs? Do we make all the platforms behave exactly like iOS? Do we only support the possible array of views, but not the objects specifying both a view and position for each view?\r\ncc [~cng][~hpham][~bhatfield][~rblalock][~ingo]", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2015-09-09T14:54:37.000+0000", "updated": "2015-09-09T14:54:37.000+0000" }, { "id": "362662", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "Here's the PR for adding support for a single or array of views to Windows SDK: https://github.com/appcelerator/titanium_mobile_windows/pull/426\r\n\r\nDoesn't add support for a single/array of objects with \"view\" and \"position\" keys.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2015-09-09T14:58:05.000+0000", "updated": "2015-09-09T14:58:05.000+0000" }, { "id": "362718", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~penrique], fyi about this. Hopefully your native auto layout for iOS will continue to support this.\r\nConsidering that we are having an overhaul on UI for iOS, we will keep iOS as it is for now and keep the \"view\" and \"position\" key undocumented.\r\n[~msamah], [~hpham], are we able to support this on Android?\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-10T04:32:58.000+0000", "updated": "2015-09-10T04:32:58.000+0000" }, { "id": "369758", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Reopening ticket:\r\n\r\nOS: Microsoft Windows 10 Pro 10.0.10240\r\nAppc core: 5.1.0-43\r\nAppc NPM: 4.2.1\r\nTi SDK: 5.1.0.v20151104190037\r\n\r\nUsing the code below the app crashes on launch on Windows, the code runs as expected on iOS \r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle:'Tab 1',\r\n\tbackgroundColor:'#fff'\r\n});\r\nvar data = [\r\n {\r\n 'top':100,\r\n 'text':'label 1'\r\n },\r\n {\r\n 'top':200,\r\n 'text':'label 2'\r\n }\r\n];\r\n \r\nvar lblArr = [];\r\nfor(var i =0; i < data.length; i++){\r\n lblArr.push(createLabel(data[i]));\r\n}\r\nwin1.add(lblArr);\r\n \r\nwin1.open();\r\n \r\nfunction createLabel(lblData){\r\n var label = Ti.UI.createLabel({\r\n text:lblData.text,\r\n color:'#999',\r\n top:lblData.top\r\n });\r\n return label;\r\n}\r\n{code}", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-11-11T16:59:21.000+0000", "updated": "2015-11-11T16:59:21.000+0000" }, { "id": "369764", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile_windows/pull/473\r\n5_1_X: https://github.com/appcelerator/titanium_mobile_windows/pull/474", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-11T17:36:28.000+0000", "updated": "2015-11-11T17:36:28.000+0000" }, { "id": "370471", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Verified using:\r\n\r\nOS: Microsoft Windows 10 Pro\r\nAppc core: 5.1.0-58\r\nAppc NPM: 4.2.1\r\nTi SDK : 5.1.0.v20151116142031, 5.2.0.v20151116164440\r\nAppc Studio: 4.4.0.201511130407\r\n\r\nUsing the code below the labels are now added to the window as expected\r\n\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle:'Tab 1',\r\n\tbackgroundColor:'#fff'\r\n});\r\nvar data = [\r\n {\r\n 'top':100,\r\n 'text':'label 1'\r\n },\r\n {\r\n 'top':200,\r\n 'text':'label 2'\r\n }\r\n];\r\n \r\nvar lblArr = [];\r\nfor(var i =0; i < data.length; i++){\r\n lblArr.push(createLabel(data[i]));\r\n}\r\nwin1.add(lblArr);\r\n \r\nwin1.open();\r\n \r\nfunction createLabel(lblData){\r\n var label = Ti.UI.createLabel({\r\n text:lblData.text,\r\n color:'#999',\r\n top:lblData.top\r\n });\r\n return label;\r\n}\r\n{code}\r\n\r\nClosing ticket ", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2015-11-17T01:15:00.000+0000", "updated": "2015-11-17T01:15:00.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }