I have already consumed the change from TIMOB-17662 by setting autorotate to false in CameraDevice.js and this issue is still present. I initially mentioned this issue in Case 2640 which has been closed so that we can focus on this specific case.
I have uploaded an app called 9-16-OppositeOrientationTest.zip and screenshots which illustrate this issue.
CASE 1 (landscape window in portrait mode)
Launch the app in Landscape mode with the Home button on the right
Rotate the app around, notice the UI changes to reflect the orientation correctly.
Get it back into landscape mode (Home button on right).
Click Launch Camera
Click the (X) button and then immediately rotate the tablet to portrait up or portrait down.
Notice that the image capture view will close and the app then rotates into landscape orientation. It should rotate to portrait orientation.
See screenshot Home On Bottom.png
CASE 2 (portrait window in landscape)
Kill the app
Launch the app in Landscape mode with the Home button on the right
Rotate the app around, notice the UI changes to reflect the orientation correctly.
Rotate the app to portrait mode (Home button on bottom).
Click Launch Camera
Click the (X) button and then immediately rotate the tablet to landscape left up or landscape right.
Notice that the image capture view will close and the app then rotates into portrait orientation. It should rotate to landscape orientation.
See screenshot Home On Right.png
Issue reproducible with the following code
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var button = Ti.UI.createButton({
title: 'Open',
top: 50,
left: 10,
right: 10,
height: 50
});
win.add(button);
win.open();
button.addEventListener('click', function() {
Ti.API.info('click');
Ti.Media.showCamera({
success: success,
error: error,
saveToPhotoGallery: false,
allowEditing: false,
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
showControls: true,
autohide: false
});
function success(e) {
Ti.API.info('Success');
}
function error(e) {
Ti.API.info('Success');
}
});
Resolving on hold, similar to TIMOB-17698 and TIMOB-17609.
Use this as a JS workaround for now
Reopening to find a code fix
Pull pending master - https://github.com/appcelerator/titanium_mobile/pull/6204 3_4_X - https://github.com/appcelerator/titanium_mobile/pull/6205
Tested the provided code using Mac osx 10.9.5 Mavericks Appcelerator Studio, build: 3.4.0.201409261245 Titanium SDK, build: 3.4.1.v20141007092513 acs@1.0.18 alloy 1.5.1 install@0.1.7 npm@1.4.23 sudo@1.0.3 titanium 3.4.0 titanium-code-processor@1.1.1 Xcode6.1GM Devices: iPad mini iOS 8.1b iPhone 6 iOS 8.1b Verified as fixed