{ "id": "174428", "key": "AC-6434", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2019-12-30T16:27:50.000+0000", "created": "2019-11-15T10:18:22.000+0000", "labels": [ "LANDSCAPE", "PORTRAIT", "extendSafeArea", "ios", "orientationChange" ], "versions": [], "issuelinks": [], "assignee": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "updated": "2019-12-30T16:27:50.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When changing orientations from portrait to landscape or in fact any other cases the home indicator doesn't behave normally.\r\nFor example, if I am in Portrait and get to landscape the home indicator remains in portrait and also the app still remain in portrait even if the view change it's position.\r\nAlso I attached some screenshots in which I rotate the device only to the right to see the behaviour.\r\n\r\n\r\nCode to reproduce the issue:\r\n\r\n{code:java}\r\nTi.Gesture.addEventListener('orientationchange',function(e) {\r\n\tif (e.orientation == Ti.UI.LANDSCAPE_LEFT || e.orientation == Ti.UI.LANDSCAPE_RIGHT) {\r\n\t\tlandscapeWindow.open();\r\n\t} else {\r\n \tlandscapeWindow.close();\r\n }\r\n});\r\n\r\nvar portraitWindow = Window(\"green\", [Ti.UI.PORTRAIT]);\r\nvar landscapeWindow = Window(\"red\", [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT]);\r\n \r\nportraitWindow.open();\r\n \r\nfunction Window(backgroundColor, orientationModes) {\r\n\tvar view = Ti.UI.createView();\r\n\t//view.backgroundColor = \"orange\";\r\n\r\n\tvar label = Ti.UI.createLabel({\r\n\t\tcolor:'#000000',\r\n\t\ttext: \"welcome\",\r\n\t\theight:'auto',\r\n\t\twidth:'auto'\r\n\t});\r\n\tview.add(label);\r\n\r\n\t//create component instance\r\n\tvar window = Ti.UI.createWindow({\r\n\t\tbackgroundColor:backgroundColor,\r\n\t\torientationModes: orientationModes,\r\n\t\t//extendSafeArea : false\r\n\t});\r\n\r\n\t\r\n\twindow.add(view);\r\n\r\n\treturn window;\r\n}\r\n{code}\r\n", "attachment": [ { "id": "67133", "filename": "output.mov", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-11-16T08:19:17.000+0000", "size": 1822408, "mimeType": "video/quicktime" }, { "id": "67130", "filename": "Simulator Screen Shot - iPhone 11 - 2019-11-15 at 12.11.17.png", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:17:32.000+0000", "size": 38102, "mimeType": "image/png" }, { "id": "67129", "filename": "Simulator Screen Shot - iPhone 11 - 2019-11-15 at 12.11.23.png", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:17:32.000+0000", "size": 32474, "mimeType": "image/png" }, { "id": "67131", "filename": "Simulator Screen Shot - iPhone 11 - 2019-11-15 at 12.11.26.png", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:17:32.000+0000", "size": 35175, "mimeType": "image/png" }, { "id": "67128", "filename": "Simulator Screen Shot - iPhone 11 - 2019-11-15 at 12.11.31.png", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:17:32.000+0000", "size": 31508, "mimeType": "image/png" }, { "id": "67127", "filename": "Simulator Screen Shot - iPhone 11 - 2019-11-15 at 12.11.35.png", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:17:32.000+0000", "size": 35175, "mimeType": "image/png" } ], "flagged": false, "summary": "Strange behaviour of iOS home indicator when changing orientations - 8.2.0.GA", "creator": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.14.5\r\n Architecture = 64bit\r\n # CPUs = 12\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 8.16.0\r\n npm Version = 6.4.1\r\nTitanium CLI\r\n CLI Version = 5.2.1\r\nTitanium SDK\r\n SDK Version = 8.2.0.GA\r\n SDK Path = /Users/cstefaniga/Library/Application Support/Titanium/mobilesdk/osx/8.2.0.GA\r\n Target Platform = iphone\r\n\r\n[TRACE] : [ioslib] Validating iOS Simulator UDID 0EEB0850-A9C1-4A58-9D00-E128D628C214\r\n[TRACE] : [ioslib] Found iOS Simulator UDID 0EEB0850-A9C1-4A58-9D00-E128D628C214\r\n[TRACE] : [ioslib] Selected iOS Simulator: iPhone 11\r\n[TRACE] : [ioslib] UDID = 0EEB0850-A9C1-4A58-9D00-E128D628C214\r\n[TRACE] : [ioslib] iOS = 13.0\r\n[TRACE] : [ioslib] Autoselected Xcode: 11.0", "comment": { "comments": [ { "id": "452711", "author": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "if you uncomment \"extendSafeArea : false\" and \"view.backgroundColor = \"orange\"\" lines you will see that will get even more problematic because also the dimensions of the view will get messed up with orientation changes.", "updateAuthor": { "name": "Claudiu Stefaniga", "key": "claudiu stefaniga", "displayName": "cstefaniga ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-15T10:25:34.000+0000", "updated": "2019-11-15T10:25:34.000+0000" }, { "id": "453319", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~Claudiu Stefaniga] This is an issue with the given app's orientation handling.\r\n\r\nThe app's \"app.js\" is listening to the \"orientationchange\" event to re-layout content. The problem with this is that the \"orientationchange\" event provides the orientation of the \"device\", not the \"app\". The native device orientation change event will always occur before the app is rotated by the OS. And some devices will be faster or slower to respond to the device orientation change before rotating the app.\r\n\r\nAlso note that the \"device\" orientation and \"app\" orientation can differ as well. Especially when using split-screen mode on a tablet, because when you hold the tablet \"landscape\", both of the displayed apps will be in \"portrait\" form. The attached app code mishandles this case.\r\n\r\nWhat you should be doing is listening to the window's \"postlayout\" event, fetch the window's width/height, and determine if it is portrait/landscape. This will also handle the split-screen case.\r\n\r\n{code:java}\r\nvar window = Ti.UI.createWindow({\r\n\t//backgroundColor : backgroundColor,\r\n\t//orientationModes : orientationModes,\r\n\t//extendSafeArea : false\r\n});\r\n\r\nvar view = Ti.UI.createView();\r\n//view.backgroundColor = \"orange\";\r\n\r\nvar label = Ti.UI.createLabel({\r\n\tcolor : '#000000',\r\n\ttext : \"welcome\",\r\n\theight : 'auto',\r\n\twidth : 'auto'\r\n});\r\nview.add(label);\r\n\r\nwindow.add(view);\r\n\r\nwindow.addEventListener(\"postlayout\", function() {\r\n\tvar windowSize = window.size;\r\n\tvar isPortrait = (windowSize.height >= windowSize.width);\r\n\tif (isPortrait) {\r\n\t\tTi.API.info(\"### Window is in portrait form.\");\r\n\r\n\t\twindow.backgroundColor = \"green\";\r\n\t} else {\r\n\t\tTi.API.info(\"### Window is in landscape form.\");\r\n\t\twindow.backgroundColor = \"red\";\r\n\t}\r\n});\r\nwindow.open();\r\n{code}\r\nNote that the use-case for \"device\" orientation is for fixed orientation apps (ex: portrait-only) that want to rotate the UI manually based on device orientation. Camera apps do this.\r\n\r\nI hope this helps.\r\n\r\n", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2019-12-27T13:33:59.000+0000", "updated": "2019-12-27T13:33:59.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }