{ "id": "84321", "key": "TIMOB-6911", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-02-10T00:10:35.000+0000", "created": "2011-12-28T14:50:01.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "14561", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "84472", "key": "TIDOC-131", "fields": { "summary": "APIDoc: Parent View's size.height (and width) will return '0' when set to auto. (Android, Parity issue)", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-02-10T00:10: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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. PROBLEM DESCRIPTION\r\nYou have a parent view with height and width set to 'auto'. When you add views to this parent view, you eventually can ask for the current width and height, via the \"size\" dictionary. In iOS, it's working just fine, you add a child view, and the parent view will get you the right height. That is not working on Android.\r\n\r\nh4. STEPS TO REPRODUCE\r\n1. Create a mobile project\r\n2. Paste the code below to the app.js\r\n3. Run in Android.\r\n\r\nh4. CODE\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nvar view = Ti.UI.createView({\r\n\theight:'auto',\r\n\twidth:'auto'\r\n});\r\n\r\nvar otherview=Ti.UI.createView({\r\n\tbackgroundColor:'white',\r\n\twidth:100,\r\n\theight:100,\r\n});\r\n\r\nview.add(otherview);\r\nwin.add(view);\r\nTi.API.info(\"View height:\");\r\nTi.API.info(view.size.height);\r\nwin.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: Parent View's size.height (and width) will return '0' when set to auto. (Parity issue)", "creator": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "subtasks": [], "reporter": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "environment": null, "comment": { "comments": [ { "id": "177550", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "On Android, dimensions are calculated when window opens, so to get dimensions of some component, you must use window's \"open\" event.\r\n\r\n{code}\r\nview.add(otherview);\r\nwin.add(view);\r\nwin.addEventListener('open', function() {\r\n Ti.API.info(\"View height:\");\r\n Ti.API.info(view.size.height);\r\n}\r\nwin.open();\r\n{code}\r\n\r\n\r\nI'm not sure is this ticket a request for a change of Android's dimension calculation functionality, but I certainly think that this is an issue on Android side.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2011-12-29T05:18:32.000+0000", "updated": "2011-12-29T05:18:32.000+0000" }, { "id": "177928", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As Ivan points out, We cannot know the view's dimensions before the view is draw on screen (which is what happens when {{win.open()}} is called). You'd either need to do this in an open event, or some other time after the view has shown.", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-03T19:49:57.000+0000", "updated": "2012-01-03T19:49:57.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }