{ "id": "146705", "key": "TIMOB-18789", "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": "2015-04-29T16:20:33.000+0000", "created": "2015-04-08T10:33:44.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "orientation", "orientationChange" ], "versions": [ { "id": "16711", "description": "Release 3.5.1", "name": "Release 3.5.1", "archived": false, "released": true, "releaseDate": "2015-03-06" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T20:56:37.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": "h5.Description:\r\nUsing window.getOrientation() can't get correct info if orientationModes is not portrait.\r\n\r\nh5.Reproduce Step:\r\nSimply run the test case in classic project. (force Orientation to Landscape_Right)\r\n{code:title=app.js}\r\nvar self = Ti.UI.createWindow({ \r\nbackgroundColor:'#ffffff', \r\norientationModes : [Ti.UI.LANDSCAPE_RIGHT]\t\r\n}); \r\nTi.API.debug('Reference'); \r\nTi.API.debug('Ti.UI.LANDSCAPE_RIGHT:' + Ti.UI.LANDSCAPE_RIGHT); \r\nTi.API.debug('Ti.UI.LANDSCAPE_LEFT:' + Ti.UI.LANDSCAPE_LEFT); \r\nTi.API.debug('Ti.UI.PORTRAIT:' + Ti.UI.PORTRAIT); \r\nTi.API.debug('Ti.UI.UPSIDE_PORTRAIT:' + Ti.UI.UPSIDE_PORTRAIT); \r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext: \"Test Window for Orientation!\",\r\n\tTop: '30%',\r\n});\r\nself.add(label);\r\n\r\n//construct UI \r\nself.addEventListener('open', function(e) { \r\nTi.API.debug('When Opened, Window Orientation:' + self.getOrientation() + \", Gesture Orientaiton:\" + Ti.Gesture.getOrientation()); \r\n}); \r\nself.addEventListener('focus', function(e) { \r\nTi.API.debug('When Focussed, Window Orientation:' + self.getOrientation() + \", Gesture Orientaiton:\" + Ti.Gesture.getOrientation()); \r\n}); \r\nTi.Gesture.addEventListener('orientationchange', function(e) { \r\nTi.API.debug('Window Orientation:' + self.getOrientation() + \", Gesture Orientaiton:\" + Ti.Gesture.getOrientation()); \r\n}); \r\nself.open();\r\n{code}\r\n\r\nh5.Expect Result:\r\nShould get the correct information about orientation.\r\n\r\nh5.Actual Result:\r\nWindow opens in landscape mode as expected, but none of the event listeners configured as in the above code log the correct orientation\r\n{code:title=iOS log}\r\n[DEBUG] : Reference \r\n[DEBUG] : Ti.UI.LANDSCAPE_RIGHT:3 \r\n[DEBUG] : Ti.UI.LANDSCAPE_LEFT:4 \r\n[DEBUG] : Ti.UI.PORTRAIT:1 \r\n[DEBUG] : Ti.UI.UPSIDE_PORTRAIT:2 \r\n[DEBUG] : Loading: /Users/achyutjoshi/Library/Developer/CoreSimulator/Devices/DEE57654-B959-4BB6-942A-370CD35E6CDC/data/Containers/Bundle/Application/EEFFC1D4-C8D4-48F0-9783-C26BAC2992EE/orientation.app/_app_props_.json, Resource: _app_props__json \r\n[DEBUG] : Forcing rotation to 3. Current Orientation 1. This is not good UI design. Please reconsider. \r\n[DEBUG] : Application booted in 130.232036 ms \r\n[DEBUG] : When Opened, Window Orientation:1, Gesture Orientaiton:1 \r\n[DEBUG] : When Focussed, Window Orientation:1, Gesture Orientaiton:1 \r\n{code}\r\n\r\nh5.Note:\r\nIf run the test code on Android device, the result will show the orientation change. like this:\r\n{code:title=Android Log}\r\n[DEBUG] : Reference \r\n[DEBUG] : Ti.UI.LANDSCAPE_RIGHT:4 \r\n[DEBUG] : Ti.UI.LANDSCAPE_LEFT:2 \r\n[DEBUG] : Ti.UI.PORTRAIT:1 \r\n[DEBUG] : Ti.UI.UPSIDE_PORTRAIT:3 \r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.orientation.OrientationActivity@421c5c30 \r\n[INFO] : I/Adreno-EGL: : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018_msm8226_LNX.LA.3.5.1_RB1__release_AU () \r\n[INFO] : I/Adreno-EGL: OpenGL ES Shader Compiler Version: E031.24.00.08 \r\n[INFO] : I/Adreno-EGL: Build Date: 03/07/14 Fri \r\n[INFO] : I/Adreno-EGL: Local Branch: \r\n[INFO] : I/Adreno-EGL: Remote Branch: quic/LNX.LA.3.5.1_RB1.1 \r\n[INFO] : I/Adreno-EGL: Local Patches: NONE \r\n[INFO] : I/Adreno-EGL: Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018 + f2fd134 + NOTHING \r\n[DEBUG] : OpenGLRenderer: Enabling debug mode 0 \r\n[DEBUG] : Window: Checkpoint: postWindowCreated() \r\n[DEBUG] : When Opened, Window Orientation:1, Gesture Orientaiton:1 \r\n[DEBUG] : When Focussed, Window Orientation:1, Gesture Orientaiton:1 \r\n[DEBUG] : Window Orientation:2, Gesture Orientaiton:2 \r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Can not Get Correct Orientation Information when orientation is not portrait", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "SDK 3.5.*\r\niOS 8.2", "closedSprints": [ { "id": 398, "state": "closed", "name": "2015 Sprint 09 SDK", "startDate": "2015-04-25T00:00:00.000Z", "endDate": "2015-05-09T00:00:00.000Z", "completeDate": "2015-05-11T14:11:17.028Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "351159", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Using the orientationModes property to force the orientation of non-modal windows is considered a bad practice and will not be supported.\r\n\r\nSee http://docs.appcelerator.com/titanium/release-notes/?version=3.4.0.GA#changes\r\n\r\nTwo options:\r\n1. Make the window modal so it can have orientations outside those specified by tiapp.xml\r\n2. Ensure that the supported orientation in tiapp.xml for iPhone idiom is set to LANDSCAPE_RIGHT", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-04-29T16:20:33.000+0000", "updated": "2015-04-29T16:20:33.000+0000" }, { "id": "414938", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T20:56:37.000+0000", "updated": "2017-03-22T20:56:37.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }