@@ -42,10 +42,10 @@ -(void)screenOrientation:(CDVInvokedUrlCommand *)command
42
42
[result addObject: [NSNumber numberWithInt: UIInterfaceOrientationPortraitUpsideDown]];
43
43
}
44
44
if (orientationMask & 4 ) {
45
- [result addObject: [NSNumber numberWithInt: UIInterfaceOrientationLandscapeLeft ]];
45
+ [result addObject: [NSNumber numberWithInt: UIInterfaceOrientationLandscapeRight ]];
46
46
}
47
47
if (orientationMask & 8 ) {
48
- [result addObject: [NSNumber numberWithInt: UIInterfaceOrientationLandscapeRight ]];
48
+ [result addObject: [NSNumber numberWithInt: UIInterfaceOrientationLandscapeLeft ]];
49
49
}
50
50
51
51
SEL selector = NSSelectorFromString (@" setSupportedOrientations:" );
@@ -61,11 +61,12 @@ -(void)screenOrientation:(CDVInvokedUrlCommand *)command
61
61
if (!_isLocked) {
62
62
_lastOrientation = [UIApplication sharedApplication ].statusBarOrientation ;
63
63
}
64
- if (orientationMask == 8 || orientationMask == 12 ) {
65
- value = [NSNumber numberWithInt: UIInterfaceOrientationLandscapeRight];
66
- } else if (orientationMask == 4 ){
64
+ UIInterfaceOrientation deviceOrientation = [UIApplication sharedApplication ].statusBarOrientation ;
65
+ if (orientationMask == 8 || (orientationMask == 12 && !UIInterfaceOrientationIsLandscape (deviceOrientation))) {
67
66
value = [NSNumber numberWithInt: UIInterfaceOrientationLandscapeLeft];
68
- } else if (orientationMask == 1 || orientationMask == 3 ) {
67
+ } else if (orientationMask == 4 ){
68
+ value = [NSNumber numberWithInt: UIInterfaceOrientationLandscapeRight];
69
+ } else if (orientationMask == 1 || (orientationMask == 3 && !UIInterfaceOrientationIsPortrait (deviceOrientation))) {
69
70
value = [NSNumber numberWithInt: UIInterfaceOrientationPortrait];
70
71
} else if (orientationMask == 2 ) {
71
72
value = [NSNumber numberWithInt: UIInterfaceOrientationPortraitUpsideDown];
0 commit comments