{ "id": "103371", "key": "TIMOB-12577", "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": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-04-22T20:46:32.000+0000", "created": "2012-10-14T17:35:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "exalture", "module_views", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2014-06-19T12:43:47.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": "When using a horizontal layout with a view where the width is Ti.UI.FILL, you expect that view to take as much width as possible without expanding outside its parent.\r\nRunning the example below, you can see that it works correctly on ios (click the label for info)\r\nOn android, the label will actually have the width of its parent, and not the expected width\r\n\r\ni did not test but i assume the problem is the same with vertical layout\r\n{code}\r\nvar win = Titanium.UI.createWindow();\r\nwin.backgroundColor = '#ccc';\r\n\r\nvar container = Ti.UI.createView({\r\n \theight:70,\r\n \tlayout:'horizontal',\r\n horizontalWrap:false,\r\n \tbackgroundColor:'red'\r\n \t})\r\nvar view = Ti.UI.createView({\r\n \twidth:100,\r\n \tbackgroundColor:'blue'\r\n \t})\r\ncontainer.add(view);\r\n\r\nvar view2 = Ti.UI.createLabel({\r\n\twidth:Ti.UI.FILL,\r\n\tbackgroundColor:'green',\r\n\ttextAlign:'right',\r\n\ttext:'TEST'\r\n})\r\ncontainer.add(view2);\r\n\r\nview2.addEventListener('click', function(e) {\r\n\talert('my width is ' + e.source.rect.width + ' when it should be ' + eval(container.rect.width - view.rect.width));\r\n})\r\nwin.add(container);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "[android] horizontal layout doesnt compute correctly", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "titanium 3.1.0 master\r\nandroid 4.0.3\r\ndevice / simulator", "comment": { "comments": [ { "id": "237158", "author": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed issue on android 4.0.3 with 3.0.0 GA on both Vertical and Horizontal layouts.", "updateAuthor": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T00:28:29.000+0000", "updated": "2013-02-05T00:28:29.000+0000" }, { "id": "241115", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The problem reproduces with release 3.0.2 and master release 3.1.0\n\ntested on\n\nTitanium Studio, build: 3.0.2.201302191606\nTitanium SDK version: 3.1.0 \nTitanium SDK version: 3.0.2 \nDevice: Samsung galaxy s duos Android version: 4.0.4\nAndroid Emulator: Android SDK version: 2.2", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-07T08:30:31.000+0000", "updated": "2013-03-07T08:30:31.000+0000" }, { "id": "246400", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Added boundary condition for width so that it doesn't exceed max width\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4115", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-08T13:15:20.000+0000", "updated": "2013-04-08T13:15:20.000+0000" }, { "id": "247208", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not an issue with vertical layouts:\n\n{code}\nvar win = Titanium.UI.createWindow();\nwin.backgroundColor = '#ccc';\n \nvar container = Ti.UI.createView({\n height:Ti.UI.FILL,\n layout:'vertical',\n // horizontalWrap:false,\n backgroundColor:'red'\n })\nvar view = Ti.UI.createView({\n height:300,\n backgroundColor:'blue'\n })\ncontainer.add(view);\n \nvar view2 = Ti.UI.createLabel({\n height:Ti.UI.FILL,\n backgroundColor:'green',\n textAlign:'right',\n text:'TEST'\n})\ncontainer.add(view2);\n \nview2.addEventListener('click', function(e) {\n alert('my width is ' + e.source.rect.height + ' when it should be ' + eval(container.rect.height - view.rect.height));\n})\nwin.add(container);\nwin.open();\n{code}\n\nTested on 3.0.2.GA", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-11T23:22:30.000+0000", "updated": "2013-04-11T23:22:30.000+0000" }, { "id": "247283", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR related to this:\n\nhttps://github.com/appcelerator/titanium_mobile/pull/4045", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-12T16:23:00.000+0000", "updated": "2013-04-12T16:23:00.000+0000" }, { "id": "248669", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "backport to 3_1_X: https://github.com/appcelerator/titanium_mobile/pull/4206", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-22T20:49:54.000+0000", "updated": "2013-04-22T20:49:54.000+0000" }, { "id": "275733", "author": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed. \n\nTiSDK 3.2.0.v20131017152001 \nCLI 3.2.0\nTitanium Studio 3.2.0.201310152326\n\nClosing.", "updateAuthor": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-18T21:09:30.000+0000", "updated": "2013-10-18T21:09:30.000+0000" }, { "id": "275753", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "great thanks for your work", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-10-18T22:26:09.000+0000", "updated": "2013-10-18T22:26:09.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }