{ "id": "163305", "key": "TIMOB-23928", "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": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-09-19T17:17:38.000+0000", "created": "2016-09-19T12:59:22.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "orientationChange" ], "versions": [ { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [], "assignee": null, "updated": "2019-09-19T17:17:38.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": "Hello,\r\n\r\nThere might be a problem with the event orientationchange : it is not triggered the first time, and is triggered just before the orientation change.\r\nThis happens since SDK 5.0.\r\nI don't have this problem with SDK 3.5.2\r\nTo understand this behaviour, I have created a new Alloy Project, and added this code in alloy.js\r\n\r\n{// The event listener\r\nTi.Gesture.addEventListener('orientationchange', function (e) {\r\n Ti.API.info('w:' + Ti.Platform.displayCaps.platformWidth + ' h:' + Ti.Platform.displayCaps.platformHeight + ' isPortrait:' + e.source.isPortrait());\r\n});\r\n\r\n// An event-independant code to \"catch\" orienation change\r\nvar prevW = Ti.Platform.displayCaps.platformWidth, prevH = Ti.Platform.displayCaps.platformHeight;\r\nsetInterval(function () {\r\n if (prevW != Ti.Platform.displayCaps.platformWidth || prevH != Ti.Platform.displayCaps.platformHeight) {\r\n prevW = Ti.Platform.displayCaps.platformWidth;\r\n prevH = Ti.Platform.displayCaps.platformHeight;\r\n Ti.API.info('orientation changed? w:' + prevW + ' h:' + prevH);\r\n }\r\n}, 10);\r\n}\r\n\r\nAnd here is the log\r\n* I was in portrait and I changed the orientation now to landscape, note the absence of the event log\r\n[INFO] : orientation changed? w:2560 h:1504\r\n* I change the orientation again from landscape to portrait... the event log shows that we are in landscape... The interval log shows we are indeed in portrait !\r\n[INFO] : w:2560 h:1504 isPortrait:false\r\n[INFO] : orientation changed? w:1600 h:2464\r\n* I change the orientation endly from portrait to landscape... the event log shows that we are now in portrait... The interval log is right the tablet is in landscape !\r\n[INFO] : w:1600 h:2464 isPortrait:true\r\n[INFO] : orientation changed? w:2560 h:1504\r\n", "attachment": [], "flagged": false, "summary": "orientationchange event problems", "creator": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK 5.x\r\nAlloy 1.8\r\nAndroid 4.1 Android 5.0+", "comment": { "comments": [ { "id": "451507", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue as “Cannot Reproduce”. We have tested the code provided, and found that it is out of date with our current release (8.1.1.GA as of the date of closure), and out of date with mobile OS versions. Updating the code may not reproduce the issue reported, or be a valid test case.\r\n\r\nIf community members feel that the issue is still valid, please add a comment, and include code that demonstrates/reproduces the issue.\r\n\r\nAxway Appcelerator Studio, build: 5.1.4.201909061933 \r\nmacOS : 10.14.6\r\nNode.js Version : 8.9.1\r\nnpm Version : 5.5.1\r\nAppcelerator CLI : 7.1.1\r\nTitanium CLI\r\nCLI Version : 5.2.1\r\nnode-appc Version : 0.2.49\r\nTitanium SDKs : 8.1.1.GA\r\nAndroid API 29", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-09-19T17:17:38.000+0000", "updated": "2019-09-19T17:17:38.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }