{ "id": "171510", "key": "TIMOB-25961", "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": "2018-04-13T14:20:31.000+0000", "created": "2018-04-13T03:10:50.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "escalation" ], "versions": [], "issuelinks": [], "assignee": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:37: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": "Basically, need to maintain the onset of UI when we in portrait and move up & down. Also another set of UI when are in landscape and move up&down. \r\n\r\nEg:\r\nif( e.orientation === Ti.UI.PORTRAIT && e.orientation === Titanium.UI.FACE_UP){\r\n\r\nupdateUI();\r\n}\r\n\r\nAlso,\r\n\r\nif( (e.orientation === Ti.UI.LANDSCAPE_LEFT || e.orientation === Ti.UI.LANDSCAPE_RIGHT) && e.orientation === Titanium.UI.FACE_UP){\r\nupdateUI()\r\n}\r\n\r\nBut it does not work. \r\n\r\n*Test Code:*\r\n\r\n\r\n{code:java}\r\nTi.Gesture.addEventListener('orientationchange', function(e) {\r\n\r\n\tif (e.orientation == Titanium.UI.FACE_DOWN) {\r\n\r\n\t\tTi.API.info(\"ORientation_FACE_DOWN:\" + e.orientation);\r\n\r\n\t} else if (e.orientation == Titanium.UI.FACE_UP) {\r\n\r\n\t\tTi.API.info(\"ORientation_FACE_UP:\" + e.orientation);\r\n\r\n\t} else if (e.orientation == Titanium.UI.PORTRAIT) {\r\n\t\tTi.API.info(\"ORientation_PORTRAIT:\" + e.orientation);\r\n\r\n\t} else if (e.orientation == Titanium.UI.UPSIDE_PORTRAIT) {\r\n\t\tTi.API.info(\"ORientation_UPSIDE_PORTRAIT:\" + e.orientation);\r\n\r\n\t} else if (e.orientation == Titanium.UI.LANDSCAPE_LEFT) {\r\n\t\tTi.API.info(\"ORientation_LANDSCAPE_LEFT:\" + e.orientation);\r\n\r\n\t} else if (e.orientation == Titanium.UI.LANDSCAPE_RIGHT) {\r\n\t\tTi.API.info(\"ORientation_LANDSCAPE_RIGHT:\" + e.orientation);\r\n\r\n\t} else {\r\n\t\tTi.API.info(\"ORientation_UNKNOWN:\" + e.orientation);\r\n\r\n\t}\r\n\r\n\tif (e.orientation == Titanium.UI.PORTRAIT && e.orientation == Titanium.UI.FACE_UP) {\r\n\r\n\t//issue is here: cannot detect this position\r\n Ti.API.info(\"ORientation_PORTRAIT_FACE_UP:\" + e.orientation);\r\n\t}\r\n\r\n\tif ((e.orientation == Ti.UI.LANDSCAPE_LEFT || e.orientation == Ti.UI.LANDSCAPE_RIGHT) && e.orientation == Titanium.UI.FACE_UP) {\r\n //issue is here: cannot detect this position\r\n\t\tTi.API.info(\"ORientation_LANDSCAPE_:FACE_UP\" + e.orientation);\r\n\t}\r\n\r\n\t\r\n});\r\n{code}\r\n\r\nThanks.\r\n", "attachment": [], "flagged": false, "summary": "iOS: e.orientation always returns 5 for landscape to FACE_UP and portrait to FACE_UP.", "creator": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.13.2\r\nNode.js\r\n Node.js Version = 8.10.0\r\n \r\n SDK Version = 7.1.0.GA\r\n Target Platform = iphone 5s v11.2.6", "closedSprints": [ { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "436862", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Orientation cannot have 2 states, it is either face up or landscape. Cannot be both at the same time. \r\n\r\nIf you want to render differently if it was landscape or portrait before moving down, you'll need to store the value in a variable that you will not override when FACE_UP and FACE_DOWN statuses are triggered.", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-13T11:49:35.000+0000", "updated": "2018-04-13T11:49:35.000+0000" }, { "id": "436869", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Rene is correct. In addition, you have to distinguish between device- and screen orientation. Here is an example:\r\n{code:js}\r\nTi.Gesture.addEventListener('orientationchange', function(e) {\r\n if (e.orientation == Titanium.UI.FACE_DOWN && Ti.Gesture.landscape) {\r\n // Face down and landscape (left or right)\r\n } else if (e.orientation == Titanium.UI.FACE_DOWN && Ti.Gesture.portrait) {\r\n // Face down and portrait\r\n }\r\n});\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-13T14:13:13.000+0000", "updated": "2018-04-13T14:13:13.000+0000" }, { "id": "436870", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "As this is not a bug I'm resolving it as \"invalid\"", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-04-13T14:20:32.000+0000", "updated": "2018-04-13T14:20:32.000+0000" }, { "id": "439946", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as invalid. If incorrect, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:37:06.000+0000", "updated": "2018-08-06T17:37:06.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }