{ "id": "152307", "key": "TIMOB-19779", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-11-06T18:16:59.000+0000", "created": "2015-10-23T20:22:21.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "orientations" ], "versions": [ { "id": "16778", "description": "Release 5.0.1", "name": "Release 5.0.1", "archived": false, "released": true, "releaseDate": "2015-09-25" }, { "id": "16904", "description": "Release 5.0.2", "name": "Release 5.0.2", "archived": true, "released": true, "releaseDate": "2015-10-01" }, { "id": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-11-06T18:17:04.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": "h6.Issue description\r\nWith the new Titanium SDK, SINCE 4.1.0, Android tablets that have their default orientation in landscape are reporting it's orientation as portrait when it is actually landscape and landscape when it is actually portrait. The customer experienced this issue using the Samsung Galaxy Tab 3 model GT-P5210.\r\n\r\nh6.Steps to replicate\r\n-Create a new titanium alloy project\r\n-Open the app folder\r\n-Replace the index.xml file inside views folder, the index.tss file inside styles folder and the index.js file inside controllers\r\n-Change orientation in emulator\r\n-Build and run\r\n-Device Orientation is sometimes detected as portrait when it is actually landscape and landscape when it is actually portrait\r\n", "attachment": [ { "id": "57125", "filename": "index.js", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-23T20:22:04.000+0000", "size": 1486, "mimeType": "text/javascript" }, { "id": "57124", "filename": "index.tss", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-23T20:22:13.000+0000", "size": 388, "mimeType": "application/octet-stream" }, { "id": "57126", "filename": "index.xml", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-23T20:21:57.000+0000", "size": 140, "mimeType": "text/xml" } ], "flagged": false, "summary": "Android orientations on orientationchange not providing accurate results in some Android Tablets", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Device Name: Galaxy tab 3 10.1 \r\nModel Number: GT-P5210 \r\nAndroid Version: 4.4.2 \r\nKernel Version: 3.4.34-2435918, dpi@SWDD5910 #1 \r\nBuild Number: KOT49H.P5210UEU0CNK1 \r\nScreen Size: 1280 x 800\r\n\r\nTitanium SDK 5.0.2GA", "comment": { "comments": [ { "id": "370482", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7455", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-17T05:08:00.000+0000", "updated": "2015-11-17T05:08:00.000+0000" }, { "id": "371079", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "I'm wondering if this ticket is related? [TIMOB-19878]", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2015-11-23T01:36:53.000+0000", "updated": "2015-11-23T01:36:53.000+0000" }, { "id": "371188", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~dawsontoth] Seems very similar, but on my tests and according to the customer shared info, the event was triggered but it was sending wrong info and not every time, I was not able to reproduce it (even in Gennymotion) but i had 2 customers with this issue if you see at the Github PR, the engineering team reproduced and solved the issue. I just have one question [~msamah], this PR was inserted on the now released SDK 5.1.0.GA or this solution still in review ? ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-23T18:13:23.000+0000", "updated": "2015-11-23T18:13:23.000+0000" }, { "id": "371353", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng] [~msamah] In which version is or will be the fix ? ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-24T17:45:06.000+0000", "updated": "2015-11-24T17:45:42.000+0000" }, { "id": "371421", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~rramirez] This is in master branch for 5.2.0 release. ", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-25T03:01:48.000+0000", "updated": "2015-11-25T03:01:48.000+0000" }, { "id": "371471", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks ! ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-11-25T18:33:53.000+0000", "updated": "2015-11-25T18:33:53.000+0000" }, { "id": "375016", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\norientationchange now returns accurate orientation on tablets.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201601131150\r\nTi SDK : 5.2.0.v20160114021251\r\nTi CLI : 5.0.5\r\nAlloy : 1.7.26\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-1\r\nAppc CLI : 5.2.0-231\r\nNode: v0.12.27\r\nSamsung Galaxy Tab SM-600 - Android 4.3 ", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-21T00:01:07.000+0000", "updated": "2016-01-21T00:01:07.000+0000" }, { "id": "379840", "author": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unfortunately this still isn't fixed perfectly\r\n\r\nCreate an app and add following\r\n\r\nTi.Gesture.addEventListener('orientationchange', function(){\r\n console.log(\"orientationchange fired\");\r\n});\r\n\r\nDeploy to an Android tablet\r\n\r\nNow hold the device in portrait and position horizontally flat, mid air\r\n\r\nNow tilt device one corner of the device up slightly and rotate round towards it being in a landscape position\r\n\r\nNote how the console.log(\"orientationchange fired\") has not been executed even though the screen has orientated\r\n\r\n", "updateAuthor": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-16T09:04:47.000+0000", "updated": "2016-03-16T09:04:47.000+0000" }, { "id": "379841", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "What device are you using and which Android version is it running?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-16T09:17:50.000+0000", "updated": "2016-03-16T09:17:50.000+0000" }, { "id": "379842", "author": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Nexus 10 ( Android 4.4.2 ) and Nexus 9 ( Android 6.0 )", "updateAuthor": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-16T09:21:25.000+0000", "updated": "2016-03-16T09:21:25.000+0000" }, { "id": "379844", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "You are using Titanium SDK 5.2.0.GA?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-16T09:25:34.000+0000", "updated": "2016-03-16T09:25:34.000+0000" }, { "id": "379846", "author": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes 5.2.0.GA", "updateAuthor": { "name": "louis.quaintance", "key": "louis.quaintance", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-16T09:29:10.000+0000", "updated": "2016-03-16T09:29:10.000+0000" }, { "id": "380264", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, I have tested the issue on Galaxy tab 4 (Android 4.4.2) with SDK 5.2.0.GA. I could not reproduce this issue. I followed the below instructions:\r\n\r\n1.Deploy to an Android tablet \r\n2.Hold the device in portrait and position then horizontally flat in mid air \r\n3.Now, tilt device one corner up slightly and rotate around towards it being in a landscape position.\r\n4.See for orientationchange event in console log.\r\n\r\nFollowing these steps, when the device changes the orientation the app detects it and fired the change event perfectly.\r\n\r\nNow, when I tried with SDK 5.1.0.GA I see that the fired event provides the wrong mode in console for 2-3 times. After that, it starts providing the right mode. \r\n\r\n{code}\r\nfunction doClick(e) {\r\n\tTi.API.info('Hello World!');\r\n}\r\n\r\nTi.Gesture.addEventListener('orientationchange', function(event) {\r\n\tTi.API.info('Gesture Orientation: ', event.orientation);\r\n\tTi.API.info('Landscape: ', Ti.Gesture.isLandscape());\r\n\tTi.API.info('Portrait: ', Ti.Gesture.isPortrait());\r\n\tconsole.log(\"orientationchange fired\");\r\n});\r\n\r\n$.index.open();\r\n{code}\r\n\r\n", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-03-21T17:19:10.000+0000", "updated": "2016-03-30T15:19:15.000+0000" }, { "id": "381129", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Unable to reproduce. If there are instructions or more details on how to reproduce, please comment.\r\nI'll resolve this as unable to reproduce if there isn't more movement on this in a few days.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-03-31T02:07:17.000+0000", "updated": "2016-03-31T02:07:17.000+0000" }, { "id": "381159", "author": { "name": "plancaster", "key": "plancaster", "displayName": "Peter Lancaster", "active": true, "timeZone": "Europe/London" }, "body": "Looking at this - could the issue be related to how sensitive the device accelerometer is, and in turn how much information it reports back for the SDK to determine a correct value to report?\r\n\r\nFor example - when @Louis and I typically see this issue - a device is rotated slowly, placed on a table carefully, or in the process of some other 'slower' action.\r\n\r\nEssentially - undertaking user actions that would trigger a device's accelerometer to report back more refined values.", "updateAuthor": { "name": "plancaster", "key": "plancaster", "displayName": "Peter Lancaster", "active": true, "timeZone": "Europe/London" }, "created": "2016-03-31T09:44:07.000+0000", "updated": "2016-03-31T09:44:07.000+0000" }, { "id": "381257", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "That's an interesting hypothesis. Does it work correctly if you turned it at a normal speed? And what's considered a `slower` action?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-01T01:55:57.000+0000", "updated": "2016-04-01T01:55:57.000+0000" }, { "id": "381280", "author": { "name": "plancaster", "key": "plancaster", "displayName": "Peter Lancaster", "active": true, "timeZone": "Europe/London" }, "body": "Typically, a 'quick' movement (e.g. a sharp or 'normal speed' turn from portrait to landscape) would see the UI update correctly in a majority of cases.\r\n\r\nBut a slower movement (e.g. a gradual turn and tilt - in the same kind of manner you would if you were playing a gravity / physics based game such as Labyrinth - or if you were carefully placing a device face up, onto a table) would trigger the error more frequently.\r\n\r\nOur theory was that once in the device accelerometer (or logic) gets into this state, it reports back in the same manner, until another 'sharp' action breaks the process (perhaps the flow inside here: https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/gesture/src/java/ti/modules/titanium/gesture/GestureModule.java - might have some link to that?).", "updateAuthor": { "name": "plancaster", "key": "plancaster", "displayName": "Peter Lancaster", "active": true, "timeZone": "Europe/London" }, "created": "2016-04-01T09:22:33.000+0000", "updated": "2016-04-01T09:22:33.000+0000" }, { "id": "381444", "author": { "name": "louis.quaintance@first-utility.com", "key": "louis.quaintance@first-utility.com", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please try this code\r\n\r\nindex.xml:\r\n\r\n\r\n\t\r\n\t\t\t\r\n\r\n\r\nindex.js:\r\n\r\nfunction setValues(){\r\n if(Ti.Gesture.isPortrait()){\r\n $.myWindow.backgroundColor = \"red\";\r\n $.text.text = \"I AM IN PORTRAIT\";\r\n } else {\r\n $.myWindow.backgroundColor = \"black\";\r\n $.text.text = \"I AM IN LANDSCAPE\";\r\n }\r\n}\r\n\r\nTi.Gesture.addEventListener(\"orientationchange\", setValues);\r\n\r\n$.myWindow.open();\r\n\r\nsetValues();\r\n", "updateAuthor": { "name": "louis.quaintance@first-utility.com", "key": "louis.quaintance@first-utility.com", "displayName": "Louis Quaintance", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-04T11:59:40.000+0000", "updated": "2016-04-04T11:59:40.000+0000" }, { "id": "381705", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~louis.quaintance] Thanks for that code. Able to reproduce the bug with what you have provided.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-05T07:45:20.000+0000", "updated": "2016-04-05T07:45:20.000+0000" }, { "id": "381857", "author": { "name": "mobihunterz", "key": "mobihunterz", "displayName": "Paresh Thakor", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am also having orientation issue with Nexus 10 device. I put alerts in orientation handing code. The alert shows wrong code for orientations sometimes. It displays portrait code for landscape orientations and landscape codes for portrait orientations.\r\n\r\nI have used Titanium SDK: 5.2.2.GA\r\nAppcelerator Studio: 4.5.0\r\nProject Type: Alloy.\r\n\r\n{quote}Orientaiton code block:{quote}\r\n\r\n\r\n{\r\nfunction handleOrientationchange(e) {\r\n\t\talert('Latest Orientation: ' + e.orientation);\r\n\t\tif (e.orientation != prevOrientation && OrientationFlag == false && e.orientation >= 1 && e.orientation <= 4) {\r\n\t\t\tOrientationFlag = true;\r\n\t\t\tif (e.orientation == Titanium.UI.UPSIDE_PORTRAIT || e.orientation == Titanium.UI.PORTRAIT) {\r\n\t\t\t\t...\r\n\t\t\t} else if (e.orientation == Titanium.UI.LANDSCAPE_RIGHT || e.orientation == Titanium.UI.LANDSCAPE_LEFT) {\r\n\t\t\t\t...\r\n\t\t\t}\r\n\t\t\tprevOrientation = e.orientation;\r\n\t\t\tOrientationFlag = false;\r\n\t\t}\r\n\t}\r\n\r\n\tTi.Gesture.addEventListener(\"orientationchange\", handleOrientationchange);\r\n}\r\n", "updateAuthor": { "name": "mobihunterz", "key": "mobihunterz", "displayName": "Paresh Thakor", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-04-06T12:39:02.000+0000", "updated": "2016-04-06T12:39:02.000+0000" }, { "id": "382009", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~mobihunterz] May I know which version of Android is being used as well?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-07T01:29:40.000+0000", "updated": "2016-04-07T01:29:40.000+0000" }, { "id": "385742", "author": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I am also experiencing this issue. Happens also Nexus 7 and 9 simulator, SDK 5.2.2.GA.", "updateAuthor": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-05-15T19:31:53.000+0000", "updated": "2016-05-15T19:31:53.000+0000" }, { "id": "386305", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~arif] Just want to know more background on this, what's the use case you are using this for?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-20T03:54:55.000+0000", "updated": "2016-05-20T03:54:55.000+0000" }, { "id": "386324", "author": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hi Ashraf, we're using it to change the UI layout for landscape vs portrait. When the user switches to landscape, we show another layout / extra columns.\r\n\r\nI've made a screencast of the issue, you can watch it here: https://streamable.com/a9qk\r\nI also made a testproject, you can download it here: https://file.io/eZ7EQ1\r\n\r\nAs you can see, the first time the device changes orientation, there's no output in the console, so it doesn't seem to detect the change. The second change, it detects the change, but wrong; landscape is detected as portrait from then on and the other way around. This is the issue with every tablet in the simulator, but I also happens on real Nexus devices.\r\n\r\n", "updateAuthor": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-05-20T08:53:54.000+0000", "updated": "2016-05-20T08:53:54.000+0000" }, { "id": "386325", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "Thanks for the screencast. That looks like a bad bug. Will need to get this investigated.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-20T09:01:12.000+0000", "updated": "2016-05-20T09:01:12.000+0000" }, { "id": "386326", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "I've put the ticket in Triage for now.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-20T09:01:31.000+0000", "updated": "2016-05-20T09:01:31.000+0000" }, { "id": "386328", "author": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "great, thanks!", "updateAuthor": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-05-20T09:15:52.000+0000", "updated": "2016-05-20T09:15:52.000+0000" }, { "id": "387738", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~mobihunterz]\r\nI'm using\r\n{code}\r\n \r\nTi.Gesture.addEventListener('orientationchange', function(e){\r\n switch(e.orientation) {\r\n case Ti.UI.LANDSCAPE_RIGHT:\r\n Ti.API.info(\"LANDSCAPE_RIGHT\");\r\n Ti.UI.createNotification({\r\n message:\"LANDSCAPE_RIGHT\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n break;\r\n case Ti.UI.LANDSCAPE_LEFT:\r\n Ti.API.info(\"LANDSCAPE_LEFT\");\r\n Ti.UI.createNotification({\r\n message:\"LANDSCAPE_LEFT\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n break;\r\n case Ti.UI.UPSIDE_PORTRAIT:\r\n Ti.API.info(\"UPSIDE_PORTRAIT\");\r\n Ti.UI.createNotification({\r\n message:\"UPSIDE_PORTRAIT\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n break;\r\n case Ti.UI.PORTRAIT:\r\n Ti.API.info(\"PORTRAIT\");\r\n Ti.UI.createNotification({\r\n message:\"PORTRAIT\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_SHORT\r\n }).show();\r\n break;\r\n default:\r\n Ti.API.info(\"Unknown!!\");\r\n } \r\n Ti.API.info(\"Portrait:\"+e.source.isPortrait());\r\n Ti.API.info(\"Landscape:\"+e.source.isLandscape());\r\n});\r\n{code}\r\nAnd having a hard time reproducing your error.", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-06-07T08:01:49.000+0000", "updated": "2016-06-07T08:15:16.000+0000" }, { "id": "394497", "author": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I am still having this issue with SDK 5.4.0.GA, on multiple simulators and different Android versions. And it doesn't happen on tablets only!\r\n\r\nA clean window with orientation listener won't detect the first orientation change. The second time it detects the change, but wrong.\r\n\r\nScreencast:https://streamable.com/r1r9\r\nProject: http://content3.skoften.net/temp/testje.zip\r\n\r\nRunning on OSX. Studio 4.7.0.201607250649.\r\n\r\nEDIT: I just tested it on 2 real devices (S6 and S6 Edge) and it works. Maybe it's an simulator-issue? Using Genymotion.\r\n", "updateAuthor": { "name": "arif", "key": "arif", "displayName": "Arjan", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-08-26T14:59:54.000+0000", "updated": "2016-08-26T15:16:59.000+0000" }, { "id": "402303", "author": { "name": "douglas_ufop", "key": "douglas_ufop", "displayName": "Douglas Alves", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "Using e.source.orientation solved it for me.\r\n\r\nif(e.source.orientation == Titanium.UI.LANDSCAPE_RIGHT || e.source.orientation == Titanium.UI.LANDSCAPE_LEFT){\r\n //Do Something\r\n}else if(e.source.orientation == Titanium.UI.PORTRAIT || e.source.orientation == Titanium.UI.UPSIDE_PORTRAIT){\r\n //Do Something\r\n}\r\n", "updateAuthor": { "name": "douglas_ufop", "key": "douglas_ufop", "displayName": "Douglas Alves", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2016-12-01T00:38:24.000+0000", "updated": "2016-12-01T00:40:25.000+0000" }, { "id": "430170", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[TIMOB-24537] resolves this. It'll introduces a breaking change where Ti.Gesture provides device orientation instead of app window orientation, like how it works on iOS and Windows Phone.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-06T18:16:59.000+0000", "updated": "2017-11-06T18:16:59.000+0000" } ], "maxResults": 38, "total": 38, "startAt": 0 } } }