From 2d8500f6a59f378473c846a86bc07935e8215ce1 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 29 Aug 2016 14:33:03 -0700 Subject: [PATCH 01/10] One js file for ios, android and windows --- .DS_Store | Bin 0 -> 6148 bytes plugin.xml | 91 +++++------ src/.DS_Store | Bin 0 -> 8196 bytes src/android/.DS_Store | Bin 0 -> 6148 bytes ...enOrientation.java => CDVOrientation.java} | 83 +++++----- src/ios/.DS_Store | Bin 0 -> 6148 bytes ...pportedOrientations.h => CDVOrientation.h} | 11 +- src/ios/CDVOrientation.m | 65 ++++++++ ...ewController+UpdateSupportedOrientations.m | 32 ---- src/ios/YoikScreenOrientation.h | 36 ----- src/ios/YoikScreenOrientation.m | 120 -------------- src/windows/.DS_Store | Bin 0 -> 6148 bytes src/windows/CDVOrientation.cs | 58 +++++++ src/wp/YoikScreenOrientation.cs | 140 ---------------- www/.DS_Store | Bin 0 -> 6148 bytes www/screenorientation.android.js | 29 ---- www/screenorientation.ios.js | 56 ------- www/screenorientation.js | 149 ++++++++++-------- www/screenorientation.windows.js | 54 ------- www/screenorientation.wp8.js | 29 ---- 20 files changed, 294 insertions(+), 659 deletions(-) create mode 100644 .DS_Store create mode 100644 src/.DS_Store create mode 100644 src/android/.DS_Store rename src/android/{YoikScreenOrientation.java => CDVOrientation.java} (57%) create mode 100644 src/ios/.DS_Store rename src/ios/{CDVViewController+UpdateSupportedOrientations.h => CDVOrientation.h} (84%) create mode 100644 src/ios/CDVOrientation.m delete mode 100644 src/ios/CDVViewController+UpdateSupportedOrientations.m delete mode 100644 src/ios/YoikScreenOrientation.h delete mode 100644 src/ios/YoikScreenOrientation.m create mode 100644 src/windows/.DS_Store create mode 100644 src/windows/CDVOrientation.cs delete mode 100644 src/wp/YoikScreenOrientation.cs create mode 100644 www/.DS_Store delete mode 100644 www/screenorientation.android.js delete mode 100644 www/screenorientation.ios.js delete mode 100644 www/screenorientation.windows.js delete mode 100644 www/screenorientation.wp8.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..76433a14551a2c397ccbade7356386c4d58b3fcb GIT binary patch literal 6148 zcmeHK&2G~`5S~o}by5yS6sZyyA3=($Ktt1GnkGnI zi6`L9|9c=f@c{5BoWjiRHfj>MLWFj#nQy#1pS}JP?|K1%H3r^I022TVbizUj!*7iG z$rmiAT8PKQHSU28t-T=Xy1_!VZqN#71(r<#dUsdgF6_ZBwBX$P8@bp+)50C}>l0y^ z0bGJUIM9Ws7*D{54R`_xL=ejNe#-kc$15Q(fB|wigvfdh&mfrPu!A{H5e{%vJJ5uE z#0_M4bByoAKrc)t7y~4JE4Eb6YlbWr!R~m9UXIhG^%cHm#tg1>bPu; zYPCw)s%~zL$L34JxOU_A&i;e`_|==Y@7{m-`04W(Aqy~^poLvgcm`iFQKFsNaTrA5 z3ARvm9)@(xNl8B|Ntv5UDXO%T08&aJ$DEX?*AklgOBkz5I5s^bt$ + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> - + Screen Orientation Adds Screen Orientation API lock and unlock functions to the global screen object in android, iOS, WP8, W8.1, and BB10. MIT - + - + - + - - + + - - - - - - - + + + + - + - - + + - - + + - - - + - + @@ -69,23 +64,13 @@ - - - - - - - - - - - - - + + + - - + + - + diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..1c7cb287244077bb77100242af63fc2af60315fb GIT binary patch literal 8196 zcmeI1&2G~`5XWbmK%Deq1W1v%_y|%Cfd<0Sqy>osQbbTIL{YGDL{_rAk?qu~qDVe) z;xYJs4+JM(fJfm}W_A~=P1*w&M8%A?^Iz}I_~R$ro816_7|f%a0Brzpu#mc&=uR=} zr?O@nwxx+GFdsmHgy>a?@>6aZ?!aP z(m|MX5cbT%&QOFtJLY*h9E5L_JriI8>jY@--hcoSh#);ae^(*)(984y%XKWxqa*Zd z(P5Fz!dOTD3}>;-@^1Hs*r?SnTx>Ya)+TN4rPlM&R28E<$miK0NT2CF8BIc49|rmK zcm0V{aa9k(T{$Vn?v-to9N%PJ()zR7^ry?W&0y@ygeD^)3JMXm`)Bbbr>X* zU75*H#xg&2nzW7G_F~c7y4&$?^?S>Xx9In~9j~`_XSsA=JI=Kmx9>fAI$OSZ`|kaR zkDoq&`KoUmg#GrwWwT%TZ|hhNMrjhOkc!6^sZ%|zC!!gxLAwHR1u-%tqX*Zs>RT<1>Nf$M9)(eP{6{Wq zOyE2bsF{mx)BOMb+3Wx3>6Z9fnE(^`Ljt0{Gujzok{;DhNv2WW!}086(oU#|xhDh-YlE994gxaPBcK(Bc-? z1OAqKb=>O=Ywotg@@muFuQuI^41e59`YGM^dq$ZQkOERb3P=Gd@H+*(_tK_EiHcG{ z3P^!Z1^oL^=#EXrJ~2KW3^4)_CrpR&I%WxC@dUA{*e5bWv!oJ}YIVf0q%&V?T~o17 zOgb!1=05dgs}qXF>CBfXhc$_cQa}m}6*$c0%=`a>{=@t~BxxlDq`<#Yz$WcYJLfCa z-a2|Y@3n<~NB=O^Mma;YVq&ynF1!_=e5osb&HGKoJ~8Ob2c4)N0oO$)1^z;TcWCPx AK>z>% literal 0 HcmV?d00001 diff --git a/src/android/YoikScreenOrientation.java b/src/android/CDVOrientation.java similarity index 57% rename from src/android/YoikScreenOrientation.java rename to src/android/CDVOrientation.java index 41674cf..3def795 100644 --- a/src/android/YoikScreenOrientation.java +++ b/src/android/CDVOrientation.java @@ -17,9 +17,9 @@ * specific language governing permissions and limitations * under the License. * -*/ + */ -package net.yoik.cordova.plugins.screenorientation; +package cordova.plugins.screenorientation; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaPlugin; @@ -31,14 +31,14 @@ import android.app.Activity; import android.content.pm.ActivityInfo; import android.util.Log; -public class YoikScreenOrientation extends CordovaPlugin { - +public class CDVOrientation extends CordovaPlugin { + private static final String TAG = "YoikScreenOrientation"; - + /** * Screen Orientation Constants */ - + private static final String UNLOCKED = "unlocked"; private static final String PORTRAIT_PRIMARY = "portrait-primary"; private static final String PORTRAIT_SECONDARY = "portrait-secondary"; @@ -46,56 +46,53 @@ public class YoikScreenOrientation extends CordovaPlugin { private static final String LANDSCAPE_SECONDARY = "landscape-secondary"; private static final String PORTRAIT = "portrait"; private static final String LANDSCAPE = "landscape"; - + @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { - + Log.d(TAG, "execute action: " + action); - + // Route the Action if (action.equals("screenOrientation")) { return routeScreenOrientation(args, callbackContext); } - + // Action not found callbackContext.error("action not recognised"); return false; } - + private boolean routeScreenOrientation(JSONArray args, CallbackContext callbackContext) { - + String action = args.optString(0); - - if (action.equals("set")) { - - String orientation = args.optString(1); - - Log.d(TAG, "Requested ScreenOrientation: " + orientation); - - Activity activity = cordova.getActivity(); - - if (orientation.equals(UNLOCKED)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); - } else if (orientation.equals(LANDSCAPE_PRIMARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } else if (orientation.equals(PORTRAIT_PRIMARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } else if (orientation.equals(LANDSCAPE)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); - } else if (orientation.equals(PORTRAIT)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); - } else if (orientation.equals(LANDSCAPE_SECONDARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); - } else if (orientation.equals(PORTRAIT_SECONDARY)) { - activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); - } - - callbackContext.success(); - return true; - - } else { - callbackContext.error("ScreenOrientation not recognised"); - return false; + + + + String orientation = args.optString(1); + + Log.d(TAG, "Requested ScreenOrientation: " + orientation); + + Activity activity = cordova.getActivity(); + + if (orientation.equals(UNLOCKED)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); + } else if (orientation.equals(LANDSCAPE_PRIMARY)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + } else if (orientation.equals(PORTRAIT_PRIMARY)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } else if (orientation.equals(LANDSCAPE)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); + } else if (orientation.equals(PORTRAIT)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + } else if (orientation.equals(LANDSCAPE_SECONDARY)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE); + } else if (orientation.equals(PORTRAIT_SECONDARY)) { + activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT); } + + callbackContext.success(); + return true; + + } } \ No newline at end of file diff --git a/src/ios/.DS_Store b/src/ios/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..810f0b6bff0bb4e3130853c679c6bc16ab4a506e GIT binary patch literal 6148 zcmeHL%Sr=55UkN0B3|~WxA_4D|6oa0!IKBUvqpso(S;E2^BMkateS4c)dg=sq#L?x zrXMpq1(`3)ME$#31&)@22tT~|`d%ea82?m0JU?3O>26n{& z&uq!`&@gN;5DWwZpA2Y!$W&qLSPbjdL8I%l;uE2SZM`Lg*|BvjhKx{>l@hHq`4b~q zIsMu5TE}8&fBjqZ+h$R-1XPV=>ey^4D@=Tm&j1 KVS<4jFz^nuwj|L2 literal 0 HcmV?d00001 diff --git a/src/ios/CDVViewController+UpdateSupportedOrientations.h b/src/ios/CDVOrientation.h similarity index 84% rename from src/ios/CDVViewController+UpdateSupportedOrientations.h rename to src/ios/CDVOrientation.h index 6cff917..48166a3 100644 --- a/src/ios/CDVViewController+UpdateSupportedOrientations.h +++ b/src/ios/CDVOrientation.h @@ -17,12 +17,15 @@ * specific language governing permissions and limitations * under the License. * -*/ + */ +#import +#import #import -@interface CDVViewController (UpdateSupportedOrientations) +@interface CDVOrientation : CDVPlugin +{} -- (void)updateSupportedOrientations:(NSArray *)orientations; +- (void)screenOrientation:(CDVInvokedUrlCommand *)command; -@end +@end \ No newline at end of file diff --git a/src/ios/CDVOrientation.m b/src/ios/CDVOrientation.m new file mode 100644 index 0000000..b38a55d --- /dev/null +++ b/src/ios/CDVOrientation.m @@ -0,0 +1,65 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +#import "CDVOrientation.h" +#import +#import + +@interface CDVOrientation () {} +@end + +@implementation CDVOrientation + +-(void)screenOrientation:(CDVInvokedUrlCommand *)command +{ + CDVPluginResult* pluginResult; + NSInteger orientationMask = [[command argumentAtIndex:0] integerValue]; + CDVViewController* vc = (CDVViewController*)self.viewController; + NSMutableArray* result = [[NSMutableArray alloc] init]; + + if(orientationMask & 1) { + [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortrait]]; + } + if(orientationMask & 2) { + [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationPortraitUpsideDown]]; + } + if(orientationMask & 4) { + [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft]]; + } + if(orientationMask & 8) { + [result addObject:[NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]]; + } + + SEL selector = NSSelectorFromString(@"setSupportedOrientations:"); + + if([vc respondsToSelector:selector]) { + ((void (*)(CDVViewController*, SEL, NSMutableArray*))objc_msgSend)(vc,selector,result); + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; + } + else { + pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_INVALID_ACTION messageAsString:@"Error calling to set supported orientations"]; + } + + [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; + +} + +@end \ No newline at end of file diff --git a/src/ios/CDVViewController+UpdateSupportedOrientations.m b/src/ios/CDVViewController+UpdateSupportedOrientations.m deleted file mode 100644 index b930923..0000000 --- a/src/ios/CDVViewController+UpdateSupportedOrientations.m +++ /dev/null @@ -1,32 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -#import "CDVViewController+UpdateSupportedOrientations.h" - -@implementation CDVViewController (UpdateSupportedOrientations) - -- (void)updateSupportedOrientations:(NSArray *)orientations { - - [self setValue:orientations forKey:@"supportedOrientations"]; - -} - -@end diff --git a/src/ios/YoikScreenOrientation.h b/src/ios/YoikScreenOrientation.h deleted file mode 100644 index f2d4c67..0000000 --- a/src/ios/YoikScreenOrientation.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -#import -#import - -@interface YoikScreenOrientation : CDVPlugin - -- (void)screenOrientation:(CDVInvokedUrlCommand *)command; -@property (strong, nonatomic) NSArray *originalSupportedOrientations; - -@end - -@interface ForcedViewController : UIViewController - -@property (strong, nonatomic) NSString *calledWith; - -@end \ No newline at end of file diff --git a/src/ios/YoikScreenOrientation.m b/src/ios/YoikScreenOrientation.m deleted file mode 100644 index 3008b0c..0000000 --- a/src/ios/YoikScreenOrientation.m +++ /dev/null @@ -1,120 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -#import "YoikScreenOrientation.h" -#import "CDVViewController+UpdateSupportedOrientations.h" - -@implementation YoikScreenOrientation - --(void)screenOrientation:(CDVInvokedUrlCommand *)command -{ - [self.commandDelegate runInBackground:^{ - - if(self.originalSupportedOrientations == nil) { - self.originalSupportedOrientations = [self.viewController valueForKey:@"supportedOrientations"]; - } - - NSArray* arguments = command.arguments; - NSString* orientationIn = [arguments objectAtIndex:1]; - - if ([orientationIn isEqual: @"unlocked"]) { - [(CDVViewController*)self.viewController updateSupportedOrientations:self.originalSupportedOrientations]; - self.originalSupportedOrientations = nil; - return; - } - - // grab the device orientation so we can pass it back to the js side. - NSString *orientation; - switch ([[UIDevice currentDevice] orientation]) { - case UIDeviceOrientationLandscapeLeft: - orientation = @"landscape-secondary"; - break; - case UIDeviceOrientationLandscapeRight: - orientation = @"landscape-primary"; - break; - case UIDeviceOrientationPortrait: - orientation = @"portrait-primary"; - break; - case UIDeviceOrientationPortraitUpsideDown: - orientation = @"portrait-secondary"; - break; - default: - orientation = @"portait"; - break; - } - - // we send the result prior to the view controller presentation so that the JS side - // is ready for the unlock call. - CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK - messageAsDictionary:@{@"device":orientation}]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - - // SEE https://github.com/Adlotto/cordova-plugin-recheck-screen-orientation - // HACK: Force rotate by changing the view hierarchy. - ForcedViewController *vc = [[ForcedViewController alloc] init]; - vc.calledWith = orientationIn; - - // backgound should be transparent as it is briefly visible - // prior to closing. - vc.view.backgroundColor = [UIColor clearColor]; - // vc.view.alpha = 0.0; - vc.view.opaque = YES; - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 - // This stops us getting the black application background flash, iOS8 - vc.modalPresentationStyle = UIModalPresentationOverFullScreen; -#endif - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.viewController presentViewController:vc animated:NO completion:nil]; - }); - - }]; -} - -@end - -@implementation ForcedViewController - --(void) viewDidAppear:(BOOL)animated { - CDVViewController *presenter = (CDVViewController*)self.presentingViewController; - - if ([self.calledWith rangeOfString:@"portrait"].location != NSNotFound) { - [presenter updateSupportedOrientations:@[[NSNumber numberWithInt:UIInterfaceOrientationPortrait]]]; - - } else if([self.calledWith rangeOfString:@"landscape"].location != NSNotFound) { - [presenter updateSupportedOrientations:@[[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft], [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight]]]; - } else { - [presenter updateSupportedOrientations:@[[NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft], [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight], [NSNumber numberWithInt:UIInterfaceOrientationPortrait]]]; - } - [presenter dismissViewControllerAnimated:NO completion:nil]; -} - -- (UIInterfaceOrientationMask) supportedInterfaceOrientations -{ - if ([self.calledWith rangeOfString:@"portrait"].location != NSNotFound) { - return UIInterfaceOrientationMaskPortrait; - } else if([self.calledWith rangeOfString:@"landscape"].location != NSNotFound) { - return UIInterfaceOrientationMaskLandscape; - } - return UIInterfaceOrientationMaskAll; -} -@end \ No newline at end of file diff --git a/src/windows/.DS_Store b/src/windows/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3d5dcd0421cb2bf6391db159c87b18d604af8d56 GIT binary patch literal 6148 zcmeH~F;Bxl427SeLnW57G2Y08#6LKdfW*Xr#0)JANEMNw?AiF)<=H+EQ9xp1K+lr> z634!4z9H@bu;uIhDX;)Ar@P|K!_@q_`^5HI#;A0z@r*}2;0asYO{%|7c<&+3(BTGG zqy8<|>bcel)_A$x^y}58U$NSM>IMCnZo3_$Oaw$g1VlgtMBw)XeD>1j2dRo8AOa%r zNx;7kh3;CL4yp0!V2C3Cb;fiUuj4F1EuNs(rb8+-G|N_Mwpu%4Shh1?T3u~Aq-HxT zcIG;5XKN=Ei`|(oQ4XuAiXtEaV*>kmyYTscPXFQjKW@^U2#CPHB4D%bx?A#<+H9S? xoX^@qzomZ|YonYYMlm%;F>ibnAAPASe$D5#>5v-j%tt#_e*~P1Oa%Udz&pFH8FK&t literal 0 HcmV?d00001 diff --git a/src/windows/CDVOrientation.cs b/src/windows/CDVOrientation.cs new file mode 100644 index 0000000..76a6b46 --- /dev/null +++ b/src/windows/CDVOrientation.cs @@ -0,0 +1,58 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var DisplayInfo = Windows.Graphics.Display.DisplayInformation; + var Orientations = Windows.Graphics.Display.DisplayOrientations; + +module.exports = { + setAllowedOrientations: function (win, fail, args) { + //console.log("setAllowedOrientations proxy called with " + args); + + try { + var prefOrients = args[0]; + var winPrefs = 0; + + if (prefOrients & 1) { // UIInterfaceOrientationPortrait + winPrefs = winPrefs | Orientations.portrait; + } + if (prefOrients & 2) { // UIInterfaceOrientationPortraitUpsideDown + winPrefs = winPrefs | Orientations.portraitFlipped; + } + if(prefOrients & 4) { // UIInterfaceOrientationLandscapeLeft + winPrefs = winPrefs | Orientations.landscape; + } + if (prefOrients & 8) { // UIInterfaceOrientationLandscapeRight + winPrefs = winPrefs | Orientations.landscapeFlipped; + } + setTimeout(function () { + DisplayInfo.autoRotationPreferences = winPrefs; + win(); + }, 0); + } + catch (err) { + console.log("error :: " + err); + fail(); + } + + } +} + +require("cordova/exec/proxy").add("CDVOrientation", module.exports); diff --git a/src/wp/YoikScreenOrientation.cs b/src/wp/YoikScreenOrientation.cs deleted file mode 100644 index 2108c54..0000000 --- a/src/wp/YoikScreenOrientation.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -using System; -using System.Net; -using System.IO; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Notification; -using Microsoft.Phone.Shell; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Ink; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using System.Windows.Threading; -using System.Runtime.Serialization; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; -using System.Threading; - -using WPCordovaClassLib.Cordova; -using WPCordovaClassLib.Cordova.Commands; -using WPCordovaClassLib.Cordova.JSON; - - -namespace WPCordovaClassLib.Cordova.Commands -{ - public class YoikScreenOrientation : BaseCommand - { - #region Static members - private const string UNLOCKED = "unlocked"; - - private const string PORTRAIT = "portrait"; - private const string PORTRAIT_PRIMARY = "portrait-primary"; - private const string PORTRAIT_SECONDARY = "portrait-secondary"; - - private const string LANDSCAPE = "landscape"; - private const string LANDSCAPE_PRIMARY = "landscape-primary"; - private const string LANDSCAPE_SECONDARY = "landscape-secondary"; - - #endregion - - /// - /// Current orientation - /// - private string currentOrientation; - - public YoikScreenOrientation() - { - - } - - /// - /// Changes the orientation - /// - - public void screenOrientation(string options) - { - string orientation = null; - try - { - orientation = JSON.JsonHelper.Deserialize(options)[0]; - } - catch (Exception ex) - { - this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION, ex.Message)); - return; - } - - if (string.IsNullOrEmpty(orientation)) - { - this.DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); - return; - } - - if (this.currentOrientation != orientation) // Might prevent flickering - { - - Deployment.Current.Dispatcher.BeginInvoke(() => - { - PhoneApplicationFrame frame; - PhoneApplicationPage page; - if (TryCast(Application.Current.RootVisual, out frame) && - TryCast(frame.Content, out page)) - { - if (orientation == PORTRAIT || orientation == PORTRAIT_PRIMARY || orientation == PORTRAIT_SECONDARY) - { - page.SupportedOrientations = SupportedPageOrientation.Portrait; - } - - else if (orientation == LANDSCAPE || orientation == LANDSCAPE_PRIMARY || orientation == LANDSCAPE_SECONDARY) - { - page.SupportedOrientations = SupportedPageOrientation.Landscape; - } - else if (orientation == UNLOCKED) - { - page.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape; - } - else - { - this.DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Screen orientation not detected.")); - return; - } - this.currentOrientation = orientation; - } - }); - - this.DispatchCommandResult(); - } - } - - static bool TryCast(object obj, out T result) where T : class - { - result = obj as T; - return result != null; - } - } -} diff --git a/www/.DS_Store b/www/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..e5fb5fad1b58e512145fbe9973c06666f5fac700 GIT binary patch literal 6148 zcmeHKyG{c!5S)b+5i}_%pmRxul0P^_p`hjmAmNIj=uRTg-v{ym{LL}rHK0?jpaCJY zds@$W?Ood=ogV;f`SP#;W&oyCp~)B#xksChN@t!(%dhw$A+`6 z`F+j5!87iuTdt_V71sO~nA3X1{$|&1*1LAiXi@h{z3j8l0?xjb@gR@ADG&9e@0BJb z7zhS}fnXpQ_yGoZW=p20j!^~!!9XzZ$$<8UL={#AJIB0ru+a5c?GvGdwl2iNRIn=8 zIkJUf9!m63D^CpbaQai}R~76WJsg%tW}Y(g$K%EF==7)D9acF;84LsiLk5n$I@9@o z&0l8pkv|NHS}+g{{4)k@vbtR@xu|ls9xP91ZKB>$CF= 0; -}; diff --git a/www/screenorientation.js b/www/screenorientation.js index dd0a596..ac468f7 100644 --- a/www/screenorientation.js +++ b/www/screenorientation.js @@ -17,78 +17,101 @@ * specific language governing permissions and limitations * under the License. * -*/ + */ -var screenOrientation = {}, - Orientations = [ - 'portrait-primary', - // The orientation is in the primary portrait mode. - 'portrait-secondary', - // The orientation is in the secondary portrait mode. - 'landscape-primary', - // The orientation is in the primary landscape mode. - 'landscape-secondary', - // The orientation is in the secondary landscape mode. - 'portrait', - // The orientation is either portrait-primary or portrait-secondary. - 'landscape' - // The orientation is either landscape-primary or landscape-secondary. - ]; + var screenOrientation = {}, + Orientations = [ + 'portrait-primary', + // The orientation is in the primary portrait mode. + 'portrait-secondary', + // The orientation is in the secondary portrait mode. + 'landscape-primary', + // The orientation is in the primary landscape mode. + 'landscape-secondary', + // The orientation is in the secondary landscape mode. + 'portrait', + // The orientation is either portrait-primary or portrait-secondary. + 'landscape' + // The orientation is either landscape-primary or landscape-secondary. + ]; -screenOrientation.Orientations = Orientations; -screenOrientation.currOrientation = 'unlocked'; + screenOrientation.Orientations = Orientations; + screenOrientation.currOrientation = 'natural'; + var orientationMask = 0; + screenOrientation.setOrientation = function(orientation) { + if(orientation == 'portrait-primary'){ + orientationMask = 1; + } + else if(orientation == 'portrait-secondary'){ + orientationMask = 2; + } + else if(orientation == 'landscape-primary'){ + orientationMask = 4; + } + else if(orientation == 'landscape-secondary'){ + orientationMask = 8; + } + else if(orientation == 'portrait'){ + orientationMask = 3; + } + else if(orientation == 'landscape'){ + orientationMask = 12; + } + else if(orientation == 'natural'){ + orientationMask = 15; + } -screenOrientation.setOrientation = function(orientation) { - //platform specific files override this function - console.log('setOrientation not supported on device'); -}; -function addScreenOrientationApi(screenObject) { - if (screenObject.unlockOrientation || screenObject.lockOrientation) { - return; - } + cordova.exec(null, null, "CDVOrientation", "screenOrientation", [orientationMask, orientation]); + //console.log('setOrientation not supported on device'); + }; - screenObject.lockOrientation = function(orientation) { - if (Orientations.indexOf(orientation) == -1) { - console.log('INVALID ORIENTATION', orientation); - return; - } - screenOrientation.currOrientation = screenObject.orientation = orientation; - screenOrientation.setOrientation(orientation); - }; + function addScreenOrientationApi(screenObject) { + if (screenObject.unlockOrientation || screenObject.lockOrientation) { + return; + } - screenObject.unlockOrientation = function() { - screenOrientation.currOrientation = screenObject.orientation = 'unlocked'; - screenOrientation.setOrientation('unlocked'); - }; -} + screenObject.lockOrientation = function(orientation) { + if (Orientations.indexOf(orientation) == -1) { + console.log('INVALID ORIENTATION', orientation); + return; + } + screenOrientation.currOrientation = screenObject.orientation = orientation; + screenOrientation.setOrientation(orientation); + }; -addScreenOrientationApi(screen); -orientationChange(); + screenObject.unlockOrientation = function() { + screenOrientation.currOrientation = screenObject.orientation = 'natural'; + screenOrientation.setOrientation('natural'); + }; + } -function orientationChange() { - var orientation; + addScreenOrientationApi(screen); + orientationChange(); - switch (window.orientation) { - case 0: - orientation = 'portrait-primary'; - break; - case 90: - orientation = 'landscape-primary'; - break; - case 180: - orientation = 'portrait-secondary'; - break; - case -90: - orientation = 'landscape-secondary'; - break; - default: - orientation = 'unknown'; - } + function orientationChange() { + var orientation; - screen.orientation = orientation; -} + switch (window.orientation) { + case 0: + orientation = 'portrait-primary'; + break; + case 90: + orientation = 'landscape-primary'; + break; + case 180: + orientation = 'portrait-secondary'; + break; + case -90: + orientation = 'landscape-secondary'; + break; + default: + orientation = 'unknown'; + } -window.addEventListener("orientationchange", orientationChange, true); + screen.orientation = orientation; + } -module.exports = screenOrientation; \ No newline at end of file + window.addEventListener("orientationchange", orientationChange, true); + + module.exports = screenOrientation; diff --git a/www/screenorientation.windows.js b/www/screenorientation.windows.js deleted file mode 100644 index a1b3af0..0000000 --- a/www/screenorientation.windows.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var screenOrientation = {}; - -screenOrientation.setOrientation = function (orientation) { - var orientationNumber; - switch (orientation) { - case 'landscape': - orientationNumber = 5; - break; - case 'portrait': - orientationNumber = 10; - break; - case 'landscape-primary': - orientationNumber = 1; - break; - case 'landscape-secondary': - orientationNumber = 4; - break; - case 'portrait-primary': - orientationNumber = 2; - break; - case 'portrait-secondary': - orientationNumber = 8; - break; - case 'unlocked': - orientationNumber = 0; - break; - default: - break; - } - Windows.Graphics.Display.DisplayInformation.autoRotationPreferences = orientationNumber; -}; - -module.exports = screenOrientation; diff --git a/www/screenorientation.wp8.js b/www/screenorientation.wp8.js deleted file mode 100644 index 8712c26..0000000 --- a/www/screenorientation.wp8.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -var exec = require('cordova/exec'), - screenOrientation = {}; - -screenOrientation.setOrientation = function(orientation) { - exec(null, null, "YoikScreenOrientation", "screenOrientation", [orientation]); -}; - -module.exports = screenOrientation; \ No newline at end of file From dd13eb5bdf7de9d766aba72416c9258b8f6c69a3 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 29 Aug 2016 16:23:51 -0700 Subject: [PATCH 02/10] add gitignore and npmignore files --- .gitignore | 29 +++++++++++++++++++++++++++++ .npmignore | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 .gitignore create mode 100644 .npmignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6df9abc --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +#If ignorance is bliss, then somebody knock the smile off my face + +*.csproj.user +*.suo +*.cache +Thumbs.db +*.DS_Store + +*.bak +*.cache +*.log +*.swp +*.user + +demo/hooks/ +demo/platforms/ +demo/plugins/ + +.vscode/ + + + + + + + + + + diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..62e8c49 --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +demo/ +tests/ From 86a9c8131d7d40906a92b6cc2ff395112fdf7039 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 29 Aug 2016 16:31:24 -0700 Subject: [PATCH 03/10] removed .DS_Store files --- .DS_Store | Bin 6148 -> 0 bytes src/.DS_Store | Bin 8196 -> 0 bytes src/android/.DS_Store | Bin 6148 -> 0 bytes src/ios/.DS_Store | Bin 6148 -> 0 bytes src/windows/.DS_Store | Bin 6148 -> 0 bytes www/.DS_Store | Bin 6148 -> 0 bytes 6 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store delete mode 100644 src/.DS_Store delete mode 100644 src/android/.DS_Store delete mode 100644 src/ios/.DS_Store delete mode 100644 src/windows/.DS_Store delete mode 100644 www/.DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 76433a14551a2c397ccbade7356386c4d58b3fcb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK&2G~`5S~o}by5yS6sZyyA3=($Ktt1GnkGnI zi6`L9|9c=f@c{5BoWjiRHfj>MLWFj#nQy#1pS}JP?|K1%H3r^I022TVbizUj!*7iG z$rmiAT8PKQHSU28t-T=Xy1_!VZqN#71(r<#dUsdgF6_ZBwBX$P8@bp+)50C}>l0y^ z0bGJUIM9Ws7*D{54R`_xL=ejNe#-kc$15Q(fB|wigvfdh&mfrPu!A{H5e{%vJJ5uE z#0_M4bByoAKrc)t7y~4JE4Eb6YlbWr!R~m9UXIhG^%cHm#tg1>bPu; zYPCw)s%~zL$L34JxOU_A&i;e`_|==Y@7{m-`04W(Aqy~^poLvgcm`iFQKFsNaTrA5 z3ARvm9)@(xNl8B|Ntv5UDXO%T08&aJ$DEX?*AklgOBkz5I5s^bt$osQbbTIL{YGDL{_rAk?qu~qDVe) z;xYJs4+JM(fJfm}W_A~=P1*w&M8%A?^Iz}I_~R$ro816_7|f%a0Brzpu#mc&=uR=} zr?O@nwxx+GFdsmHgy>a?@>6aZ?!aP z(m|MX5cbT%&QOFtJLY*h9E5L_JriI8>jY@--hcoSh#);ae^(*)(984y%XKWxqa*Zd z(P5Fz!dOTD3}>;-@^1Hs*r?SnTx>Ya)+TN4rPlM&R28E<$miK0NT2CF8BIc49|rmK zcm0V{aa9k(T{$Vn?v-to9N%PJ()zR7^ry?W&0y@ygeD^)3JMXm`)Bbbr>X* zU75*H#xg&2nzW7G_F~c7y4&$?^?S>Xx9In~9j~`_XSsA=JI=Kmx9>fAI$OSZ`|kaR zkDoq&`KoUmg#GrwWwT%TZ|hhNMrjhOkc!6^sZ%|zC!!gxLAwHR1u-%tqX*Zs>RT<1>Nf$M9)(eP{6{Wq zOyE2bsF{mx)BOMb+3Wx3>6Z9fnE(^`Ljt0{Gujzok{;DhNv2WW!}086(oU#|xhDh-YlE994gxaPBcK(Bc-? z1OAqKb=>O=Ywotg@@muFuQuI^41e59`YGM^dq$ZQkOERb3P=Gd@H+*(_tK_EiHcG{ z3P^!Z1^oL^=#EXrJ~2KW3^4)_CrpR&I%WxC@dUA{*e5bWv!oJ}YIVf0q%&V?T~o17 zOgb!1=05dgs}qXF>CBfXhc$_cQa}m}6*$c0%=`a>{=@t~BxxlDq`<#Yz$WcYJLfCa z-a2|Y@3n<~NB=O^Mma;YVq&ynF1!_=e5osb&HGKoJ~8Ob2c4)N0oO$)1^z;TcWCPx AK>z>% diff --git a/src/ios/.DS_Store b/src/ios/.DS_Store deleted file mode 100644 index 810f0b6bff0bb4e3130853c679c6bc16ab4a506e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHL%Sr=55UkN0B3|~WxA_4D|6oa0!IKBUvqpso(S;E2^BMkateS4c)dg=sq#L?x zrXMpq1(`3)ME$#31&)@22tT~|`d%ea82?m0JU?3O>26n{& z&uq!`&@gN;5DWwZpA2Y!$W&qLSPbjdL8I%l;uE2SZM`Lg*|BvjhKx{>l@hHq`4b~q zIsMu5TE}8&fBjqZ+h$R-1XPV=>ey^4D@=Tm&j1 KVS<4jFz^nuwj|L2 diff --git a/src/windows/.DS_Store b/src/windows/.DS_Store deleted file mode 100644 index 3d5dcd0421cb2bf6391db159c87b18d604af8d56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~F;Bxl427SeLnW57G2Y08#6LKdfW*Xr#0)JANEMNw?AiF)<=H+EQ9xp1K+lr> z634!4z9H@bu;uIhDX;)Ar@P|K!_@q_`^5HI#;A0z@r*}2;0asYO{%|7c<&+3(BTGG zqy8<|>bcel)_A$x^y}58U$NSM>IMCnZo3_$Oaw$g1VlgtMBw)XeD>1j2dRo8AOa%r zNx;7kh3;CL4yp0!V2C3Cb;fiUuj4F1EuNs(rb8+-G|N_Mwpu%4Shh1?T3u~Aq-HxT zcIG;5XKN=Ei`|(oQ4XuAiXtEaV*>kmyYTscPXFQjKW@^U2#CPHB4D%bx?A#<+H9S? xoX^@qzomZ|YonYYMlm%;F>ibnAAPASe$D5#>5v-j%tt#_e*~P1Oa%Udz&pFH8FK&t diff --git a/www/.DS_Store b/www/.DS_Store deleted file mode 100644 index e5fb5fad1b58e512145fbe9973c06666f5fac700..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKyG{c!5S)b+5i}_%pmRxul0P^_p`hjmAmNIj=uRTg-v{ym{LL}rHK0?jpaCJY zds@$W?Ood=ogV;f`SP#;W&oyCp~)B#xksChN@t!(%dhw$A+`6 z`F+j5!87iuTdt_V71sO~nA3X1{$|&1*1LAiXi@h{z3j8l0?xjb@gR@ADG&9e@0BJb z7zhS}fnXpQ_yGoZW=p20j!^~!!9XzZ$$<8UL={#AJIB0ru+a5c?GvGdwl2iNRIn=8 zIkJUf9!m63D^CpbaQai}R~76WJsg%tW}Y(g$K%EF==7)D9acF;84LsiLk5n$I@9@o z&0l8pkv|NHS}+g{{4)k@vbtR@xu|ls9xP91ZKB>$CF Date: Tue, 30 Aug 2016 17:11:10 -0700 Subject: [PATCH 04/10] changed orientation spec and modified Readme --- README.md | 32 ++++++-------------------------- src/android/CDVOrientation.java | 5 ++--- www/screenorientation.js | 10 +++++----- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 9cd5d8c..af4b755 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,9 @@ cordova plugin add cordova-plugin-screen-orientation #### landscape > The orientation is either landscape-primary or landscape-secondary (sensor). +#### any +> orientation is landscape-primary or landscape-secondary (sensor). + ## Usage ```js @@ -101,38 +104,15 @@ window.addEventListener("orientationchange", function(){ The __screen.orientation__ property will not update when the phone is [rotated 180 degrees](http://www.quirksmode.org/dom/events/orientationchange.html). -## iOS Notes - -The iOS version is a combination of the cordova JS callback _window.shouldRotateToOrientation_ and the workaround to recheck the orientation as implemented in https://github.com/Adlotto/cordova-plugin-recheck-screen-orientation. - -__If you have a custom implementation of the _window.shouldRotateToOrientation_ it will have to be removed for the plugin to function as expected.__ - -#### iOS6 - -There has been a few cases where the rotation does not change the width of the viewport - -Issue [#1](https://github.com/gbenvenuti/cordova-plugin-screen-orientation/issues/1) @dokterbob - ->It seems to be related to having width=device-width, height=device-height in the meta viewport (which is part of the boilerplate phonegap/cordova app). It can be solved by updating the viewport with width=device-height, height=device-width or simply removing width and height altogether. - -#### iOS8 - -Versions prior to 1.2.0 will cause an application crash in iOS8 due to a change in presentViewController timing. - ## BB10 Notes Wraps the com.blackberry.app plugin functions, auto installed as a dependancy. -## WP8 Notes - -Windows phone does not support specification or primary and secondary orientations. If called with a specific orientation the plugin will just apply the landscape or portait orientation. - -## W8.1 Notes - -Windows 8.1 Applicaitons (runtime/metro applications) will only display orientation changes if the device has some sort of accelerometer. The internal state of the "orientation" will still be kept, but the actual screen won't rotate unless the device supports it. - # Changelog +## 2.0 +* Common javascript for iOS, Android and Windows. + ## 1.4.2 * [#101](https://github.com/gbenvenuti/cordova-plugin-screen-orientation/pull/101) make iOS rotate as needed when lockOrientation is called diff --git a/src/android/CDVOrientation.java b/src/android/CDVOrientation.java index 3def795..c7dc207 100644 --- a/src/android/CDVOrientation.java +++ b/src/android/CDVOrientation.java @@ -33,13 +33,12 @@ import android.util.Log; public class CDVOrientation extends CordovaPlugin { - private static final String TAG = "YoikScreenOrientation"; /** * Screen Orientation Constants */ - private static final String UNLOCKED = "unlocked"; + private static final String ANY = "any"; private static final String PORTRAIT_PRIMARY = "portrait-primary"; private static final String PORTRAIT_SECONDARY = "portrait-secondary"; private static final String LANDSCAPE_PRIMARY = "landscape-primary"; @@ -74,7 +73,7 @@ public class CDVOrientation extends CordovaPlugin { Activity activity = cordova.getActivity(); - if (orientation.equals(UNLOCKED)) { + if (orientation.equals(ANY)) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } else if (orientation.equals(LANDSCAPE_PRIMARY)) { activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); diff --git a/www/screenorientation.js b/www/screenorientation.js index ac468f7..77f1f9f 100644 --- a/www/screenorientation.js +++ b/www/screenorientation.js @@ -36,7 +36,7 @@ ]; screenOrientation.Orientations = Orientations; - screenOrientation.currOrientation = 'natural'; + screenOrientation.currOrientation = 'any'; var orientationMask = 0; screenOrientation.setOrientation = function(orientation) { if(orientation == 'portrait-primary'){ @@ -57,7 +57,7 @@ else if(orientation == 'landscape'){ orientationMask = 12; } - else if(orientation == 'natural'){ + else if(orientation == 'any'){ orientationMask = 15; } @@ -81,8 +81,8 @@ }; screenObject.unlockOrientation = function() { - screenOrientation.currOrientation = screenObject.orientation = 'natural'; - screenOrientation.setOrientation('natural'); + screenOrientation.currOrientation = screenObject.orientation = 'any'; + screenOrientation.setOrientation('any'); }; } @@ -106,7 +106,7 @@ orientation = 'landscape-secondary'; break; default: - orientation = 'unknown'; + orientation = 'any'; } screen.orientation = orientation; From f881c95e9a580d9bccf7ee531291afb0b1b4cac9 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Tue, 30 Aug 2016 17:12:46 -0700 Subject: [PATCH 05/10] basic tests added --- tests/plugin.xml | 31 +++++++++++++++++++++++++++++++ tests/tests.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 tests/plugin.xml create mode 100644 tests/tests.js diff --git a/tests/plugin.xml b/tests/plugin.xml new file mode 100644 index 0000000..5d01bad --- /dev/null +++ b/tests/plugin.xml @@ -0,0 +1,31 @@ + + + + + Cordova Screen Orientation Plugin Tests + Apache 2.0 + + + + diff --git a/tests/tests.js b/tests/tests.js new file mode 100644 index 0000000..7a28ff5 --- /dev/null +++ b/tests/tests.js @@ -0,0 +1,36 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +/* jshint jasmine: true */ + +exports.defineAutoTests = function() { + describe('Orientation Information (window.orientation)', function () { + it("should exist", function() { + expect(window.orientation).toBeDefined(); + }); + + it("should contain a platform specification that is a string", function() { + expect(window.orientation).toBeDefined(); + expect((String(window.orientation.type)).length > 0).toBe(true); + }); + + }); +}; From 90f5f2531a6a354d8e8b889e707099b214d9e09d Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Tue, 20 Sep 2016 10:36:36 -0700 Subject: [PATCH 06/10] Added promises to plugin --- www/screenorientation.js | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/www/screenorientation.js b/www/screenorientation.js index 77f1f9f..8aaa51f 100644 --- a/www/screenorientation.js +++ b/www/screenorientation.js @@ -1,3 +1,4 @@ +cordova.define("cordova-plugin-screen-orientation.screenorientation", function(require, exports, module) { /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -72,12 +73,29 @@ } screenObject.lockOrientation = function(orientation) { - if (Orientations.indexOf(orientation) == -1) { - console.log('INVALID ORIENTATION', orientation); - return; - } - screenOrientation.currOrientation = screenObject.orientation = orientation; - screenOrientation.setOrientation(orientation); + + var p = new Promise(function(resolve,reject){ + if (Orientations.indexOf(orientation) == -1) { + // console.log('INVALID ORIENTATION', orientation); + var err = new Error(); + err.name = "NotSupportedError"; + + reject(err);//"cannot change orientation"); + + } + else { + screenOrientation.currOrientation = screenObject.orientation = orientation; + screenOrientation.setOrientation(orientation); + resolve("Orientation changed"); // orientation change successful + } + + + + + }); + return p; + + }; screenObject.unlockOrientation = function() { @@ -115,3 +133,5 @@ window.addEventListener("orientationchange", orientationChange, true); module.exports = screenOrientation; + +}); From 84b013f17c71922fa42bfd9185dbc9be3a1fe831 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 17 Oct 2016 11:12:53 -0700 Subject: [PATCH 07/10] added comments and formatted code --- www/screenorientation.js | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/www/screenorientation.js b/www/screenorientation.js index 8aaa51f..e03f7ee 100644 --- a/www/screenorientation.js +++ b/www/screenorientation.js @@ -32,33 +32,35 @@ cordova.define("cordova-plugin-screen-orientation.screenorientation", function(r // The orientation is in the secondary landscape mode. 'portrait', // The orientation is either portrait-primary or portrait-secondary. - 'landscape' + 'landscape', // The orientation is either landscape-primary or landscape-secondary. + 'any' + // All orientations are supported ]; screenOrientation.Orientations = Orientations; screenOrientation.currOrientation = 'any'; var orientationMask = 0; screenOrientation.setOrientation = function(orientation) { - if(orientation == 'portrait-primary'){ + if(orientation == Orientations[0]){ orientationMask = 1; } - else if(orientation == 'portrait-secondary'){ + else if(orientation == Orientations[1]){ orientationMask = 2; } - else if(orientation == 'landscape-primary'){ + else if(orientation == Orientations[2]){ orientationMask = 4; } - else if(orientation == 'landscape-secondary'){ + else if(orientation == Orientations[3]){ orientationMask = 8; } - else if(orientation == 'portrait'){ + else if(orientation == Orientations[4]){ orientationMask = 3; } - else if(orientation == 'landscape'){ + else if(orientation == Orientations[5]){ orientationMask = 12; } - else if(orientation == 'any'){ + else if(orientation == Orientations[6]){ orientationMask = 15; } @@ -73,29 +75,24 @@ cordova.define("cordova-plugin-screen-orientation.screenorientation", function(r } screenObject.lockOrientation = function(orientation) { - + var p = new Promise(function(resolve,reject){ if (Orientations.indexOf(orientation) == -1) { - // console.log('INVALID ORIENTATION', orientation); var err = new Error(); err.name = "NotSupportedError"; - + reject(err);//"cannot change orientation"); - + } else { screenOrientation.currOrientation = screenObject.orientation = orientation; screenOrientation.setOrientation(orientation); - resolve("Orientation changed"); // orientation change successful + resolve("Orientation set"); // orientation change successful } - - - - - }); + }); return p; - - + + }; screenObject.unlockOrientation = function() { From 5d97d51144c5b1dad40b650e160e3ef8bde41a1b Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 17 Oct 2016 16:25:16 -0700 Subject: [PATCH 08/10] added demo project and modified version --- README.md | 13 +---- demo/config.xml | 26 +++++++++ demo/www/css/index.css | 115 +++++++++++++++++++++++++++++++++++++++ demo/www/img/logo.png | Bin 0 -> 21814 bytes demo/www/index.html | 58 ++++++++++++++++++++ demo/www/js/index.js | 96 ++++++++++++++++++++++++++++++++ package.json | 2 +- plugin.xml | 2 +- www/screenorientation.js | 2 +- 9 files changed, 300 insertions(+), 14 deletions(-) create mode 100644 demo/config.xml create mode 100644 demo/www/css/index.css create mode 100644 demo/www/img/logo.png create mode 100644 demo/www/index.html create mode 100644 demo/www/js/index.js diff --git a/README.md b/README.md index af4b755..51ee123 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,6 @@ The plugin adds the following to the screen object (`window.screen`): ## Install -_cordova < 4_ - -```bash -cordova plugin add net.yoik.cordova.plugins.screenorientation -``` -_cordova > 4_ ```bash cordova plugin add cordova-plugin-screen-orientation @@ -68,7 +62,7 @@ cordova plugin add cordova-plugin-screen-orientation > The orientation is either landscape-primary or landscape-secondary (sensor). #### any -> orientation is landscape-primary or landscape-secondary (sensor). +> orientation is unlocked - all orientations are supported. ## Usage @@ -88,9 +82,6 @@ console.log('Orientation is ' + screen.orientation); Both android and iOS will fire the orientationchange event on the window object. For this version of the plugin use the window object if you require notification. -For this plugin to follow the full API events should be fired on the screen object. -iOS and BB10 do not currently support events on the _screen_ object so custom event -handling will need to be added (Suggestions welcome!). ### Example usage @@ -110,7 +101,7 @@ Wraps the com.blackberry.app plugin functions, auto installed as a dependancy. # Changelog -## 2.0 +## 2.0.0 * Common javascript for iOS, Android and Windows. ## 1.4.2 diff --git a/demo/config.xml b/demo/config.xml new file mode 100644 index 0000000..97595db --- /dev/null +++ b/demo/config.xml @@ -0,0 +1,26 @@ + + + ScreenOrientationDemo + + A sample Apache Cordova application that showcases the Screenorientation plugin. + + + Apache Cordova Team + + + + + + + + + + + + + + + + + + diff --git a/demo/www/css/index.css b/demo/www/css/index.css new file mode 100644 index 0000000..51daa79 --- /dev/null +++ b/demo/www/css/index.css @@ -0,0 +1,115 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { + -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */ +} + +body { + -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */ + -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */ + -webkit-user-select: none; /* prevent copy paste, to allow, change 'none' to 'text' */ + background-color:#E4E4E4; + background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%); + background-image:-webkit-gradient( + linear, + left top, + left bottom, + color-stop(0, #A7A7A7), + color-stop(0.51, #E4E4E4) + ); + background-attachment:fixed; + font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif; + font-size:12px; + height:100%; + margin:0px; + padding:0px; + text-transform:uppercase; + width:100%; +} + +/* Portrait layout (default) */ +.app { + background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */ + position:absolute; /* position in the center of the screen */ + left:50%; + top:50%; + height:50px; /* text area height */ + width:225px; /* text area width */ + text-align:center; + padding:180px 0px 0px 0px; /* image height is 200px (bottom 20px are overlapped with text) */ + margin:-115px 0px 0px -112px; /* offset vertical: half of image height and text area height */ + /* offset horizontal: half of text area width */ +} + +/* Landscape layout (with min-width) */ +@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) { + .app { + background-position:left center; + padding:75px 0px 75px 170px; /* padding-top + padding-bottom + text area = image height */ + margin:-90px 0px 0px -198px; /* offset vertical: half of image height */ + /* offset horizontal: half of image width and text area width */ + } +} + +h1 { + font-size:24px; + font-weight:normal; + margin:0px; + overflow:visible; + padding:0px; + text-align:center; +} + +.event { + border-radius:4px; + -webkit-border-radius:4px; + color:#FFFFFF; + font-size:12px; + margin:0px 30px; + padding:2px 0px; +} + +.event.listening { + background-color:#333333; + display:block; +} + +.event.received { + background-color:#4B946A; + display:none; +} + +@keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +@-webkit-keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.4; } + to { opacity: 1.0; } +} + +.blink { + animation:fade 3000ms infinite; + -webkit-animation:fade 3000ms infinite; +} diff --git a/demo/www/img/logo.png b/demo/www/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..9519e7dd78adb6e44548c08510a7bf02442a7697 GIT binary patch literal 21814 zcmV*iKuy1iP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#G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Q#*CDXE=7g?7VR4R$!4>u|bJWV{vSS0aj)a{C&?hN9U#~!&wX>CH z-&Tz@@s!ui(-gna6riID$IrsqIX4Mr2jZdzZB-@W)Dkqk?{O13rimEM(vv^mP8Z-@ z^Ef`{q=}9(W(1U3W;4yCv&Q*0H8A;@pgxZD%sp<_J(=l9p%rJEutl zol{P)O&ga_ + + + + + + + + + + Hello World + + +
+

Apache Cordova

+ +
+ + +
+
+ + +
+ +
+ + + + diff --git a/demo/www/js/index.js b/demo/www/js/index.js new file mode 100644 index 0000000..3df971c --- /dev/null +++ b/demo/www/js/index.js @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +var app = { + // Application Constructor + initialize: function() { + this.bindEvents(); + }, + // Bind Event Listeners + // + // Bind any events that are required on startup. Common events are: + // 'load', 'deviceready', 'offline', and 'online'. + bindEvents: function() { + document.addEventListener('deviceready', this.onDeviceReady, false); + + }, + // deviceready Event Handler + // + // The scope of 'this' is the event. In order to call the 'receivedEvent' + // function, we must explicitly call 'app.receivedEvent(...);' + onDeviceReady: function() { + app.receivedEvent('deviceready'); + btnPortrait.addEventListener("click", function() { + // alert('Orientation is ' + screen.orientation); + screen.lockOrientation('portrait').then(function(obj) { + console.log(obj); + }).catch(function(obj) { + console.log(obj); + }); + }); + btnLandscape.addEventListener("click", function() { + // alert('Orientation is ' + screen.orientation); + screen.lockOrientation('landscape').then(function(obj) { + console.log(obj); + }).catch(function(obj) { + console.log(obj); + }); + }); + btnPortPrimary.addEventListener("click", function() { + // alert('Orientation is ' + screen.orientation); + screen.lockOrientation('portrait-primary').then(function(obj) { + console.log(obj); + }).catch(function(obj) { + console.log(obj); + }); + }); + btnLandPrimary.addEventListener("click", function() { + // alert('Orientation is ' + screen.orientation); + screen.lockOrientation('landscape-primary').then(function(obj) { + console.log(obj); + }).catch(function(obj) { + console.log(obj); + }); + }); + btnAny.addEventListener("click", function() { + // alert('Orientation is ' + screen.orientation); + screen.lockOrientation('any').then(function(obj) { + console.log(obj); + }).catch(function(obj) { + console.log(obj); + }); + }); + + + + + }, + // Update DOM on a Received Event + receivedEvent: function(id) { + var parentElement = document.getElementById(id); + var listeningElement = parentElement.querySelector('.listening'); + var receivedElement = parentElement.querySelector('.received'); + + listeningElement.setAttribute('style', 'display:none;'); + receivedElement.setAttribute('style', 'display:block;'); + + console.log('Received Event: ' + id); + } +}; + +app.initialize(); \ No newline at end of file diff --git a/package.json b/package.json index 62589d9..b440fa4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-screen-orientation", - "version": "1.4.2", + "version": "2.0.0-dev", "description": "Adds Screen Orientation API lock and unlock functions to the global screen object in android, iOS, WP8, W8.1, and BB10.", "repository": { "type": "git", diff --git a/plugin.xml b/plugin.xml index 205a6a5..b777d6f 100644 --- a/plugin.xml +++ b/plugin.xml @@ -18,7 +18,7 @@ + version="2.0.0-dev"> Screen Orientation Adds Screen Orientation API lock and unlock functions to the global screen object in android, iOS, WP8, W8.1, and BB10. diff --git a/www/screenorientation.js b/www/screenorientation.js index e03f7ee..d574faa 100644 --- a/www/screenorientation.js +++ b/www/screenorientation.js @@ -35,7 +35,7 @@ cordova.define("cordova-plugin-screen-orientation.screenorientation", function(r 'landscape', // The orientation is either landscape-primary or landscape-secondary. 'any' - // All orientations are supported + // All orientations are supported (unlocked orientation) ]; screenOrientation.Orientations = Orientations; From 35f68c985e0daa3fc9704b08a1a145df2a93adc0 Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 17 Oct 2016 16:27:43 -0700 Subject: [PATCH 09/10] modified Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51ee123..dd306f1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ # Cordova Screen Orientation Plugin -Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10. This plugin is based on an early version of [Screen Orientation API](http://www.w3.org/TR/screen-orientation/) so the api does not currently match the current spec. +Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10. This plugin is based on [Screen Orientation API](http://www.w3.org/TR/screen-orientation/) so the api does not currently match the current spec. The plugin adds the following to the screen object (`window.screen`): From f2f2dbde729b9d3ac5884de6ee80ae354a3bf5ef Mon Sep 17 00:00:00 2001 From: maverickmishra Date: Mon, 17 Oct 2016 16:29:20 -0700 Subject: [PATCH 10/10] rectified Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dd306f1..a632e6f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ # Cordova Screen Orientation Plugin -Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10. This plugin is based on [Screen Orientation API](http://www.w3.org/TR/screen-orientation/) so the api does not currently match the current spec. +Cordova plugin to set/lock the screen orientation in a common way for iOS, Android, WP8 and Blackberry 10. This plugin is based on [Screen Orientation API](http://www.w3.org/TR/screen-orientation/) so the api matches the current spec. The plugin adds the following to the screen object (`window.screen`):