{ "id": "87350", "key": "TIMOB-7917", "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": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13170", "name": "Sprint 2012-06", "archived": true, "released": true, "releaseDate": "2012-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-03-14T14:22:21.000+0000", "created": "2012-03-05T12:11:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_platform", "qe-testadded" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2012-07-09T13:43:48.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\nNote that the Environment (above) does not display all of the relevent information:\r\n- Titanium Mobile SDK 1.8.2 and 1.8.1\r\n- Android 3.2 emulator (honeycomb), WXGA, app run in \"zoom to fill screen\" mode\r\n- Also seen on Acer Icona Tab A200 tablet (honeycomb) and Asus Transformer Prime tablet (ICS)\r\n- Windows 7\r\n- Titanium Studio 1.0.9.201202141208\r\n\r\nTi.Platform.displayCaps.platformWidth, when called repeatedly with some calls to Ti.Platform.displayCaps.dpi mixed in, returns 2 different numbers.\r\n\r\nThe first call to Ti.Platform.displayCaps.platformWidth seems to return the correct value (545 in my case, since the emulator starts off in landscape orientation). After calling Ti.Platform.displayCaps.dpi, the next call to Ti.Platform.displayCaps.platformWidth returns an incorrect value (1280 in my case). This incorrect value is the WXGA width (as if the app were not being run in \"zoom mode\"). Continuing this pattern of calls, eventually the result of Ti.Platform.displayCaps.platformWidth will start returning the correct value again (545).\r\n\r\nIt is therefore impossible to reliably determine the dimensions of the screen.\r\n\r\nh2.Testcase\r\n{code:title=app.js}\r\nvar LastPW=null;\r\nvar LastDPI,Result;\r\nfor (var c=0; (c < 12); c++)\r\n{\r\n Result=Ti.Platform.displayCaps.platformWidth;\r\n LastDPI=Ti.Platform.displayCaps.dpi;\r\n Ti.API.info('*--> '+'platformWidth returning:'+Result);\r\n if ((LastPW != null) && (Result != LastPW))\r\n Ti.API.info('*--> '+'CHANGE IN platformWidth');\r\n LastPW=Result; \r\n}\r\nTi.API.info('*--> '+'Done');\r\n{code}\r\n\r\nh4.Console output:\r\n{noformat}\r\n>platformWidth returning:545\r\n>platformWidth returning:1280\r\n>CHANGE IN platformWidth\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>platformWidth returning:545\r\n>CHANGE IN platformWidth\r\n>platformWidth returning:1280\r\n>CHANGE IN platformWidth\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>platformWidth returning:1280\r\n>Done\r\n{noformat}\r\n\r\nh2.Expected Result\r\nTi.Platform.displayCaps.platformWidth should consistently return 545 in this test case.\r\n\r\nh2.More Information\r\nIf you remove the call to Ti.Platform.displayCaps.dpi, the problem does not occur.", "attachment": [], "flagged": false, "summary": "Android: Ti.Platform.displayCaps.platformWidth return value changes on Honeycomb tablet when app is run in \"zoom\" mode", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "- Titanium Mobile SDK 1.8.2 and 1.8.1\r\n- Android 3.2 emulator (honeycomb), WXGA, app run in \"zoom to fill screen\" mode\r\n- Also seen on Acer Icona Tab A200 tablet (honeycomb) and Asus Transformer Prime tablet (ICS)\r\n- Windows 7\r\n- Titanium Studio 1.0.9.201202141208\r\n", "comment": { "comments": [ { "id": "186213", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Suspect this is due to deprecation of the previous getWidth, etc method on the Android Display object that is updated with 3.2 (lvl 13)", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-03-13T09:59:05.000+0000", "updated": "2012-03-13T09:59:05.000+0000" }, { "id": "186396", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "PR https://github.com/appcelerator/titanium_mobile/pull/1669 opened", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-03-14T07:19:34.000+0000", "updated": "2012-03-14T07:19:34.000+0000" }, { "id": "186917", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing bug. Verified fix on:\r\n\r\nSDK build: 2.0.0.v20120316124800\r\nRuntime: v8, rhino\r\nTitanium Studio, build: 2.0.0.201203152033\r\nDevice: Xoom (3.2.1)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-03-16T16:40:54.000+0000", "updated": "2012-03-16T16:40:54.000+0000" }, { "id": "187148", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Verified fix on SDK 2.0.0.v20120319003254. Thanks!", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-19T12:48:05.000+0000", "updated": "2012-03-19T12:48:05.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }