[TIMOB-11213] iOS: orientation - iOS 6 only: Forcing landscape on a window then opening an email dialog in portrait will result in your original window allowed to rotate to portrait
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-10-06T02:44:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.1.3, Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20 |
Components | iOS |
Labels | qe-ios090112, qe-ios6, qe-nfc, qe-port |
Reporter | Eric Merriman |
Assignee | Vishal Duggal |
Created | 2012-09-28T22:30:48.000+0000 |
Updated | 2012-10-06T02:44:15.000+0000 |
Description
While investigating an issue posted on the Q&A, I was unable to reproduce the exact problem, but did discover another:
When you allow only portrait in Tiapp.xml:
And then open a window with landscape left allowed and attempt to send a mail, the email dialog can rotate as you wish. If you close the email dialog and return to your window in portrait, the win will be in portrait - which shouldn't be allowed.
Sample code:
var win= Ti.UI.createWindow({
orientationModes:[Ti.UI.LANDSCAPE_LEFT],
backgroundColor:'red'
});
var button = Ti.UI.createButton({title:"Click me", height:60, width:200});
button.addEventListener('click', function(){
Titanium.Media.takeScreenshot(function(event)
{
// set blob on image view
var myImage = event.media;
var emailDialog = Titanium.UI.createEmailDialog();
if (!emailDialog.isSupported()) {
Ti.UI.createAlertDialog({
title:'Error',
message:'Email not available'
}).show();
return;
}
emailDialog.setSubject('Hello from Titanium!');
emailDialog.setToRecipients(['foo@yahoo.com']);
emailDialog.setMessageBody('<b>Appcelerator Titanium Rocks!</b>å');
emailDialog.setHtml(true);
emailDialog.setBarColor('#336699');
// attach a blob
emailDialog.addAttachment(event.media);
emailDialog.addEventListener('complete',function(e)
{
if (e.result == emailDialog.SENT)
{
if (Ti.Platform.osname != 'android') {
// android doesn't give us useful result codes.
// it anyway shows a toast.
alert("message was sent");
}
}
else
{
alert("message was not sent. result = " + e.result);
}
});
emailDialog.open();
});
});
win.add(button);
win.open();
Steps to reproduce:
1) Create a new application
2) Set tiapp.xml to portrait orientation as above
3) Use sample code
4) Launch sample app in portrait orientation, not splash is portrait as desired
5) Note window is locked landscape left - Click the "Click me" button
5) note email dialog comes up in portrait
6) Cancel email
Result:
The red window is now displayed in portrait - any orientation change returns it to its only approved orientation
Expected:
The red window does not change orientation
Note: this does not occur on iOS 5 devices
Attachments
File | Date | Size |
---|---|---|
dismissed_alert.png | 2012-10-01T23:05:56.000+0000 | 26398 |
expected.png | 2012-09-28T22:30:48.000+0000 | 24340 |
force_rotation_landscape_locked.png | 2012-10-01T23:05:56.000+0000 | 23973 |
force_rotation_portrait.png | 2012-10-01T23:05:56.000+0000 | 134515 |
left_landscape_email_cancel.png | 2012-10-01T23:05:56.000+0000 | 130933 |
unexpected.png | 2012-09-28T22:30:48.000+0000 | 25396 |
Adding screenshots for a different behavior dated 01/Oct. Steps to reproduce: 1) Create a new application 2) Set tiapp.xml to portrait orientation as above 3) Use sample code 4) Launch sample app in portrait orientation 5) Note window is locked landscape left - Click the "Click me" button 5) note email dialog comes up in portrait 6) Cancel email 7) The red window with an Alert "message was not sent, result=0" is displayed in landscape left 8) Rotate device or put it down and pick it up 9) The red window with an Alert "message was not sent, result=0" is displayed in portrait 10)Click OK 11) Rotate device anyhow Result: The red window is now displayed in locked landscape left orientation Expected: The red window does not change orientation *Note: this does not occur on iOS 5 devices* Tested on: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 3.0.0.v20120929141713 Titanium SDK: 2.1.3.v20120928203111 Devices: iPhone5 ios 6.0
Closing as fixed. Confirmed with: Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 3.0.0.v20121002114914 Titanium SDK: 2.1.3.v20121002110115 Xcode 4.5 Titanium Studio, build: 2.1.2.201208301612 Titanium SDK: 2.1.2GA Xcode 4.4.1 iPhone5 ios 6.0
Reopened to adjust remaining estimate.