{ "id": "107500", "key": "TIMOB-12599", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-04-24T17:22:36.000+0000", "created": "2013-01-07T15:02:40.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "defect", "exalture", "label", "parity", "toimage", "triage", "width" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-30T21:23:41.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\nTitanium documentation says that width property value of 'auto' has been deprecated and to use Ti.UI.SIZE. However, setting label.width to Ti.UI.SIZE causes label.toImage().width to always return value of 100. Setting the label.width to 'auto' always returns the correct width. This problem occurs on Android only and is not a problem on iOS so this is a parity issue. \r\n\r\nh2.Testcase\r\n\r\n Run enclosed app.js file on Android emulator. This app will display two labels. Label one will be created with width:'auto' and label two will be created with width:Ti.UI.SIZE. The function .toImage() will be called to get the width of each label. The results will be displayed in the console. \r\n\r\n Expected Result \r\n <----- The width of label one using property width:'auto' is 145 ----->\r\n <----- The width of label two using property width:Ti.UI.Size is 145 ----->'\r\n\r\n Actual Result \r\n <----- The width of label one using property width:'auto' is 145 ----->\r\n <----- The width of label two using property width:Ti.UI.Size is 100 ----->'\r\n\r\n{panel:title=app.js}\r\n{code}\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n backgroundColor:'blue'\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'yellow',\r\n\ttop:100,\r\n\ttext:'This is label one',\r\n\twidth:'auto'\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'red',\r\n\ttop:200,\r\n\ttext:'This is label two',\r\n\twidth:Ti.UI.SIZE\r\n});\r\n\r\nwin1.add(label1);\r\nwin1.add(label2);\r\n\r\nwin1.open();\r\n\r\nTi.API.info('<------- The width of label one using property width:\\'auto\\' is ' + label1.toImage().width + ' ------->');\r\nTi.API.info('<------- The width of label two using property width:Ti.UI.Size is ' + label2.toImage().width + ' ------->');\r\n\r\n{code}\r\n{panel}", "attachment": [], "flagged": false, "summary": "Android: label.toImage().width does not return correct width when Ti.UI.SIZE is assigned", "creator": { "name": "joejohnson", "key": "joejohnson", "displayName": "Joe Johnson", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "joejohnson", "key": "joejohnson", "displayName": "Joe Johnson", "active": true, "timeZone": "America/New_York" }, "environment": "Android 2.2 (Emulator)\r\nTitanium Mobile SDK 3.0.0.GA\r\nWindows 7 ", "comment": { "comments": [ { "id": "237278", "author": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Have you tested on device? I've tested it on devices and it shows the same behavior on both platforms. The auto has been deprecated so don't use it. I've one question, if your environment is windows then how can you test iOS on that? Please test it on a device. ", "updateAuthor": { "name": "nsharma", "key": "nsharma", "displayName": "Nikhil Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-05T21:18:41.000+0000", "updated": "2013-02-05T21:18:41.000+0000" }, { "id": "237288", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Nikhil, he has not tested this on the device...this bug is submitted as a bug in the emulator.\n\nThe only reason 'auto' was used in the testcode was to show that there is a difference between 'auto' and Ti.UI.SIZE. The code for 'auto' produces the correct result, so it was provided to shed some light on the potential problem. As many develpers do, everything is tested on the emulator first. If it doesn't work there, testing never gets to the device.\n\nAs far as the Windows environment goes, this bug was submitted as an Android bug, which he runs on Windows. The code was copied to a Mac Mini to test on iOS, which functions correctly, so there was no need to specify the Mac environment info.\n\nIf you need any more additional information, please let me know.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-02-05T22:04:48.000+0000", "updated": "2013-02-05T22:04:48.000+0000" }, { "id": "237418", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Lots of updates to this ticket last night, but still in \"Resolved, Needs more info\" status?\r\n", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2013-02-06T13:19:50.000+0000", "updated": "2013-02-06T13:19:50.000+0000" }, { "id": "248929", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Tried with SDK 3.2.0 on Nexus S device and Emulator 2.2, shows the same value for both labels.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-04-24T17:22:36.000+0000", "updated": "2013-04-24T17:22:36.000+0000" }, { "id": "416391", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce the issue using the following environment; \r\nPixel (7.1) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.3 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-30T21:23:41.000+0000", "updated": "2017-03-30T21:23:41.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }