{ "id": "148775", "key": "AC-165", "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": "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": "2015-11-14T01:59:13.000+0000", "created": "2015-06-15T12:14:55.000+0000", "labels": [ "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-11-14T01:59:13.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "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": "I have added eventListener for orientation change\r\n\r\nTi.Gesture.addEventListener('orientationchange', function(e) {\r\n\tif (e.orientation === Titanium.UI.PORTRAIT || e.orientation === Titanium.UI.UPSIDE_PORTRAIT) {\r\n\r\n\t\talert(e.orientation);\r\n\t} else if (e.orientation === Titanium.UI.LANDSCAPE_LEFT || e.orientation === Titanium.UI.LANDSCAPE_RIGHT) {\r\n\r\n\t\talert(e.orientation);\r\n\r\n\t}\r\n});\r\n\r\n And when I change the orientation it is fire but when I close the window and open it again then it does not fire.\r\nI also remove the listener on window close event\r\n\r\nTi.Gesture.removeEventListener('orientationchange'); \r\n\r\nif orientation is applied to one window on orientationchange event then orientationchange event for other window does not fire", "attachment": [], "flagged": false, "summary": "Unable to set layout for iPad in different Orientation for multiple window", "creator": { "name": "surajGupta", "key": "surajgupta", "displayName": "suraj gupta", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "surajGupta", "key": "surajgupta", "displayName": "suraj gupta", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "364072", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tested this issue using the sample code below. If you want to have some windows (or tabs) in one orientation and other windows in another orientation – enable each of the supported orientations in tiapp.xml, then specify each window's orientation using [win.orientationModes|http://docs.appcelerator.com/platform/latest/#!/guide/Orientation-section-29004932_Orientation Limitingorientationmodessupportedbyawindow] property.\r\n\r\n*Test Environments:*\r\n\r\nCLI Version :4.1.3\r\nTitanium SDK Version:4.1.1.GA\r\nDevice:iPad\r\nAppc Studio: Appcelerator Studio, build: 4.1.1.201507141126\r\nAlloy: 1.7.6\r\nMac OS X,Version = 10.10.1.\r\n\r\n*Test Steps:*\r\n\r\n1) Create classic project\r\n2) Copy sample code to resource directory\r\n3) Run project\r\n\r\n*Test code:*\r\n\r\n *app.js*\r\n\r\n {code}\r\n\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nwin1.orientationModes = [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT,Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT];\r\n\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar label1 = Titanium.UI.createLabel({\r\ncolor:'#999',\r\ntext:'I am Window 1',\r\nfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\ntextAlign:'center',\r\nwidth:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\n\r\n//\r\n// create controls tab and root window\r\n//\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nwin2.orientationModes = [Ti.UI.PORTRAIT, Ti.UI.UPSIDE_PORTRAIT,Titanium.UI.LANDSCAPE_LEFT,Titanium.UI.LANDSCAPE_RIGHT];\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\nvar label2 = Titanium.UI.createLabel({\r\ncolor:'#999',\r\ntext:'I am Window 2',\r\nfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\ntextAlign:'center',\r\nwidth:'auto'\r\n});\r\n\r\nwin2.add(label2);\r\n\r\n\r\n\r\nTi.Gesture.addEventListener('orientationchange', function(e) {\r\nif (e.orientation === Titanium.UI.PORTRAIT || e.orientation === Titanium.UI.UPSIDE_PORTRAIT)\r\n{ \r\nalert(e.orientation);\r\nTi.API.info(\"orentation is\"+e.orientation);\r\n}\r\nelse if (e.orientation === Titanium.UI.LANDSCAPE_LEFT || e.orientation === Titanium.UI.LANDSCAPE_RIGHT)\r\n{ \r\nalert(e.orientation); \r\nTi.API.info(\"orentation is\"+e.orientation);\r\n}\r\n});\r\n//\r\n// add tabs\r\n//\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\n\r\n// open tab group\r\ntabGroup.open();\r\n\r\n\r\n {code}\r\n\r\n\r\n\r\n**Test Result*:*\r\n\r\nDifferent Orientation for multiple windows in iPad is working as expected.Check [it|http://i57.tinypic.com/25pkdxt.png] for window one and [this|http://i57.tinypic.com/1038ia0.png] for window two using tab group.\r\n\r\nIf you observe different results, please post runnable sample code.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-16T11:26:39.000+0000", "updated": "2015-11-14T01:59:04.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }