{ "id": "116178", "key": "TIMOB-14285", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-11-17T15:27:49.000+0000", "created": "2013-06-19T15:08:03.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-11-29T19:47:24.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": "h2. problem\r\n\r\nWhen using {{applyProperties()}} to add a number of properties to a Titanium proxy object, custom properties are not added on Android. On iOS and Mobileweb all properties, including custom ones, are added with the {{applyProperties()}} call. Android leaves the custom properties as {{undefined}}.\r\n\r\nh2. expected\r\n\r\nAndroid should behave like other supported platforms and attach custom properties to the Titanium proxy object when they are added via {{applyProperties()}}.\r\n\r\nh2. test case\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff',\r\n\tfullscreen: false,\r\n\texitOnClose: true\r\n});\r\nwin.open();\r\n\r\nwin.applyProperties({\r\n\tcustomString: 'Ti.UI.Window',\r\n\tcustomArray: ['class1','class2','class3'],\r\n\tcustomObject: {\r\n\t\tx: 1,\r\n\t\ty: 2,\r\n\t\tz: 3\r\n\t},\r\n\tnavBarHidden: true,\r\n\tbackgroundGradient: {\r\n type: 'linear',\r\n startPoint: { x: '0%', y: '50%' },\r\n endPoint: { x: '100%', y: '50%' },\r\n colors: [ \r\n \t{ color: 'red', offset: 0.0}, \r\n \t{ color: 'blue', offset: 0.25 }, \r\n \t{ color: 'red', offset: 1.0 } \r\n ],\r\n }\r\n});\r\n\r\nTi.API.info('customString: ' + JSON.stringify(win.customString));\r\nTi.API.info('customArray: ' + JSON.stringify(win.customArray));\r\nTi.API.info('customObject: ' + JSON.stringify(win.customObject));\r\nTi.API.info('navBarHidden: ' + JSON.stringify(win.navBarHidden));\r\nTi.API.info('backgroundGradient: ' + JSON.stringify(win.backgroundGradient));\r\n{code}\r\n\r\nh2. output\r\n\r\niOS does not show the {{backgroundGradient}} after the {{applyProperties()}} call, but this is a peripheral issue not associated with this ticket.\r\n\r\nh4. iOS 6.1 iPhone sim\r\n{code}\r\n[INFO] customString: \"Ti.UI.Window\"\r\n[INFO] customArray: [\"class1\",\"class2\",\"class3\"]\r\n[INFO] customObject: {\"x\":1,\"y\":2,\"z\":3}\r\n[INFO] navBarHidden: true\r\n[INFO] backgroundGradient: {}\r\n{code}\r\n\r\nh4. Android 2.3.3 HVGA emulator\r\n{code}\r\nI/TiAPI ( 517): customString: undefined\r\nI/TiAPI ( 517): customArray: undefined\r\nI/TiAPI ( 517): customObject: undefined\r\nI/TiAPI ( 517): navBarHidden: true\r\nI/TiAPI ( 517): backgroundGradient: {\"endPoint\":{\"y\":\"50%\",\"x\":\"100%\"},\"type\":\"linear\",\"colors\":[{\"offset\":0,\"color\":\"red\"},{\"offset\":0.25,\"color\":\"blue\"},{\"offset\":1,\"color\":\"red\"}],\"startPoint\":{\"y\":\"50%\",\"x\":\"0%\"}}\r\n{code}\r\n\r\nh4. mobileweb + chrome\r\n{code}\r\n[INFO] customString: \"Ti.UI.Window\"\r\n[INFO] customArray: [\"class1\",\"class2\",\"class3\"]\r\n[INFO] customObject: {\"x\":1,\"y\":2,\"z\":3}\r\n[INFO] navBarHidden: true\r\n[INFO] backgroundGradient: {\"type\":\"linear\",\"startPoint\":{\"x\":\"0%\",\"y\":\"50%\"},\"endPoint\":{\"x\":\"100%\",\"y\":\"50%\"},\"colors\":[{\"color\":\"red\",\"offset\":0},{\"color\":\"blue\",\"offset\":0.25},{\"color\":\"red\",\"offset\":1}]} \r\n{code}", "attachment": [], "flagged": false, "summary": "Android: applyProperties() does not apply custom properties to proxy", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 3.1.1.GA\r\nAndroid 2.3.3 HVGA emulator\r\niOS 6.1 iPhone sim\r\nMobileweb + Chrome", "closedSprints": [ { "id": 752, "state": "closed", "name": "2016 Sprint 23 SDK", "startDate": "2016-11-05T00:39:37.027Z", "endDate": "2016-11-19T01:39:00.000Z", "completeDate": "2016-11-29T06:51:57.887Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "298564", "author": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "body": "+1 for this issue", "updateAuthor": { "name": "lsdriscoll", "key": "lsdriscoll", "displayName": "Lee Driscoll", "active": true, "timeZone": "Europe/London" }, "created": "2014-03-25T14:27:01.000+0000", "updated": "2014-03-25T14:27:01.000+0000" }, { "id": "325390", "author": { "name": "ahmedrshdy", "key": "ahmedrshdy", "displayName": "Ahmed Roshdy", "active": true, "timeZone": "Africa/Cairo" }, "body": "+1 to fix this", "updateAuthor": { "name": "ahmedrshdy", "key": "ahmedrshdy", "displayName": "Ahmed Roshdy", "active": true, "timeZone": "Africa/Cairo" }, "created": "2014-09-24T08:28:21.000+0000", "updated": "2014-09-24T08:28:21.000+0000" }, { "id": "332191", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "+1 -- wish this was higher priority... ", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2014-11-14T15:20:14.000+0000", "updated": "2014-11-14T15:20:14.000+0000" }, { "id": "352120", "author": { "name": "mano_mykingdom", "key": "mano_mykingdom", "displayName": "Manojkumar Murugesan", "active": true, "timeZone": "Asia/Kolkata" }, "body": "+1", "updateAuthor": { "name": "mano_mykingdom", "key": "mano_mykingdom", "displayName": "Manojkumar Murugesan", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-05-10T17:11:21.000+0000", "updated": "2015-05-10T17:11:21.000+0000" }, { "id": "369070", "author": { "name": "mano_mykingdom", "key": "mano_mykingdom", "displayName": "Manojkumar Murugesan", "active": true, "timeZone": "Asia/Kolkata" }, "body": "+1, We are into cross platform, iOS and Android should act similarly.", "updateAuthor": { "name": "mano_mykingdom", "key": "mano_mykingdom", "displayName": "Manojkumar Murugesan", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2015-11-05T08:30:02.000+0000", "updated": "2015-11-05T08:30:02.000+0000" }, { "id": "375585", "author": { "name": "botmaster", "key": "botmaster", "displayName": "Pascal", "active": true, "timeZone": "Europe/Berlin" }, "body": "+1, higher priority please!", "updateAuthor": { "name": "botmaster", "key": "botmaster", "displayName": "Pascal", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-02-01T09:43:04.000+0000", "updated": "2016-02-01T09:43:04.000+0000" }, { "id": "379394", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "any chance of this getting bumped up?", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-09T22:30:35.000+0000", "updated": "2016-03-09T22:30:35.000+0000" }, { "id": "383002", "author": { "name": "chrisribe", "key": "chrisribe", "displayName": "christian ribe", "active": true, "timeZone": "America/Los_Angeles" }, "body": "+1 same issue here.... This should act the same independently of the platform !\r\nAny workarounds ?", "updateAuthor": { "name": "chrisribe", "key": "chrisribe", "displayName": "christian ribe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-18T19:12:24.000+0000", "updated": "2016-04-18T19:12:24.000+0000" }, { "id": "383769", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "applyProperties doesn't seem to be working for Android.\r\nDoing something like this works though if you need a workaround:-\r\n{code}\r\nwin.customThings = \"customThings\";\r\n{code}", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-25T07:20:58.000+0000", "updated": "2016-04-25T07:20:58.000+0000" }, { "id": "383791", "author": { "name": "chrisribe", "key": "chrisribe", "displayName": "christian ribe", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks Ashraf,\r\n\r\nYes I noticed that setting it directly works. This should be relatively easy to patch...", "updateAuthor": { "name": "chrisribe", "key": "chrisribe", "displayName": "christian ribe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-25T12:42:09.000+0000", "updated": "2016-04-25T12:42:09.000+0000" }, { "id": "399932", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/8557", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-27T12:38:01.000+0000", "updated": "2016-10-27T12:38:01.000+0000" }, { "id": "402217", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using the code in the description was able to view the custom properties in the console when running on an android device; this is shown below as you can see it no longer says \"Undefined\" for customString, customArray, customObject and navBarHidden. \r\n{code:java}\r\n[INFO] : customString: \"Ti.UI.Window\"\r\n[INFO] : customArray: [\"class1\",\"class2\",\"class3\"]\r\n[INFO] : customObject: {\"z\":3,\"x\":1,\"y\":2}\r\n[INFO] : navBarHidden: true\r\n[INFO] : backgroundGradient: {\"startPoint\":{\"x\":\"0%%\",\"y\":\"50%%\"},\"endPoint\":{\"x\":\"100%%\",\"y\":\"50%%\"},\"type\":\"linear\",\"colors\":[{\"offset\":0,\"color\":\"red\"},{\"offset\":0.25,\"color\":\"blue\"},{\"offset\":1,\"color\":\"red\"}]}\r\n{code}\r\n\r\n*Environment* \r\n{code:java}\r\nAppcelerator Command-Line Interface, version 6.0.0\r\nAndroid 7.0 (Google Nexus 6P)\r\nOperating System Name: Mac OS X El Capitan\r\nOperating System Version: 10.11.6\r\nNode.js Version: 4.6.0\r\nnpm: 4.2.8\r\nTitanium CLI Version: 5.0.10\r\nTitanium SDK Version: 6.1.0.v20161129071600\r\nXcode: 8.0\r\nAppcelerator Studio: 4.8.0.201611121409\r\n{code}\r\n\r\n\r\n", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-29T19:46:34.000+0000", "updated": "2016-11-29T19:46:34.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }