{ "id": "94352", "key": "TIMOB-10353", "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-08-27T16:39:54.000+0000", "created": "2012-07-03T07:50:35.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:12:06.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h3. Problem description\r\nisPortrait() returns incorrect value when app is started with iPad flat and in portrait mode\r\n\r\nh3. Steps to reproduce and sample code\r\nPut iPad into portrait mode and lay flat on a table.\r\nStart the app (see sample code) and click on the button\r\n\r\nisPortrait() returns false but Ti.UI.getOrientation() correctly returns Ti.UI.PORTRAIT\r\n\r\n\r\nh5. Sample code:\r\n\r\n{code}\r\nvar win1 = Titanium.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nvar portrait, orientation;\r\n\r\n// Create a Button.\r\nvar button = Ti.UI.createButton({\r\n\ttitle : 'Click',\r\n\theight : 100,\r\n\twidth : 200,\r\n\ttop : 40\r\n});\r\nbutton.addEventListener('click', function(){\r\n\tportrait = Ti.Gesture.isPortrait();\r\n\torientation = Ti.UI.getOrientation();\r\n\talert('isPortrait: ' + portrait + '--' + 'getOrientation: ' + orientation);\r\n\tportrait = null;\r\n\torientation = null;\r\n});\r\nwin1.add(button);\r\n\r\nwin1.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: isPortrait() returns incorrect value when app is started with iPad flat and in portrait mode", "creator": { "name": "mike@teamworkpm.net", "key": "mike@teamworkpm.net", "displayName": "Mike Butler", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "2.1.1 GA \r\niOS 5.1.2 on iPad 2 and 3", "comment": { "comments": [ { "id": "216348", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ti.Gesture works on the physical device, not on the UI. When the device is flat on the table, Ti.Gesture.Orientation is \"Face up\". This is not portrait. Therefore, it returns false, as per design. Perhaps there should be a Ti.UI.isPortrait that actually reflects the UI orientation, not the device orientation.\r\n\r\nMarking as invalid.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-08-27T16:39:36.000+0000", "updated": "2012-08-27T16:39:36.000+0000" }, { "id": "410941", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:12:06.000+0000", "updated": "2017-03-09T23:12:06.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }