{ "id": "63714", "key": "TIMOB-3082", "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": "11242", "name": "Release 1.6.0 M09", "archived": true, "released": true, "releaseDate": "2011-02-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T02:00:52.000+0000", "created": "2011-04-15T03:36:27.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "regression", "release-1.6.0", "reported-1.6.0" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T02:00:52.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": "{html}

Generally speaking: if a heavyweight window's\nlayout property is set to vertical via\nits proxy after the window is already open, things added\nto the window after that don't respect the vertical layout.

\n

The KitchenSink vertical layout test is a good example: the\nheader doesn't show.

\n

But here's a simpler app.js failcase:

\n
\nTitanium.UI.setBackgroundColor('#000');\n\nvar win = Titanium.UI.createWindow({  \n    backgroundColor:'#000',\n    exitOnClose: true,\n    fullscreen: true,\n    navBarHidden: true\n});\n\nwin.open();\n\nwin.layout = 'vertical';\n\nfor (var i = 0; i < 10; i++) {\n    win.add( Ti.UI.createLabel({ text: 'Label ' + i, height: 40 }) );\n}\n
\n

The labels added there near the end will all stack up on each\nother in the middle of the window.

{html}", "attachment": [], "flagged": false, "summary": "Android: Vertical layout test in KS is missing header", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "130026", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

The reason this happens is that when

\n

win.layout = 'vertical';

\n

occurs in the code above, the view (TiUIWindow) has not yet been\nset as a model listener on the window proxy. So though KrollProxy\nfires a property change when layout gets set,\nTiUIWindow doesn't know about it and doesn't set its layout\naccordingly (the propertyChanged code in TiUIWindow\ndoesn't run.)

\n

setModelListener gets called when the new activity\nsends the MSG_ACTIVITY_CREATED message back to\nTiUIWindow (see TiUIWindow's handleMessage). For\nreasons I don't understand, that doesn't happen until all these\nviews (in the for loop in my code sample above) have\nalready been created and added to the window.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:36:27.000+0000", "updated": "2011-04-15T03:36:27.000+0000" }, { "id": "130027", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

I misspoke in the previous comment. The\nMSG_ACTIVITY_CREATED handling in TiUIWindow occurs\nbefore views get added to the window. But layout was\nnot being handled in processProperties (which runs\nwhen setModelListener is set). When he handle it in\nprocessProperties, everything works fine.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:36:27.000+0000", "updated": "2011-04-15T03:36:27.000+0000" }, { "id": "130028", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [bd9d12403051a464ec102f46aac9c4420a45a7e6])\n[#3082 state:fixed-in-qa] Add 'layout' to one of\nthe properties checked and handled in TiUIWindow processProperties\n\nhttps://github.com/appcelerator/titanium_mobile/commit/bd9d12403051...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:36:28.000+0000", "updated": "2011-04-15T03:36:28.000+0000" }, { "id": "130029", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

[INFO] Titanium SDK version: 1.6.0 (02/08/11\n20:55 bd9d124...) galaxy tab (2.2.2) G1 (1.6) Nexus S (2.3) sim\n2.1

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:36:28.000+0000", "updated": "2011-04-15T03:36:28.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }