Description problem
When doing a change of orientation when you opening different windows you will get an undesired offset in the tabs when coming back to previous window.
Actual Results
When you come back to the previous window, the window is moved by an offset.
Expected Results
The window not moved.
Test Case
1. Hold the device in portrait and launch the app.
2. Now click the window, it will launch the blue window in landscape.
3. Tilt the device to landscape.
4. Now place it on the table.
5. Click on the blue window. Now the blue window will close, and you can see the parent window displayed in portrait mode, but it would have either moved a little to the top or a little down (check the attached screen).
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
win1.orientationModes=[
Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT
];
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
gl = {};
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
Ti.include('win2.js');
win1.addEventListener('click',function(){
gl.createNewWindow();
});
win1.add(label1);
tabGroup.addTab(tab1);
tabGroup.open();
gl.createNewWindow = function(){
var win2 = Titanium.UI.createWindow({
title:'I am window2',
backgroundColor:'blue'
});
win2.orientationModes=[
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT
];
win2.open();
win2.addEventListener('click',function(e){
//Ti.Android.currentActivity.setRequestedOrientation(Ti.Android.SCREEN_ORIENTATION_PORTRAIT);
win2.close();
Ti.UI.orientation = Titanium.Gesture.orientation;
})
}
HD Discussion
http://support-admin.appcelerator.com/display/APP-851611/conversation/read_all
Ti.UI.orientation is a deprecated property and is not guaranteed to work. orientationModes is the preferred way to control window orientations.
Using deprecated property + there is no clear indication as to what the code is trying to accomplish
Added this info, the link to the docs and the example of code into the HD. Best, Mauro
Hello, the customer was using a deprecated call to the API. ONce it's using the recent one, there is no bug anymore. Best, Mauro
Closing ticket as invalid.