cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [04/16] cordova-plugin-screen-orientation git commit: changed orientation spec and modified Readme
Date Tue, 13 Dec 2016 23:48:32 GMT
 changed orientation spec and modified Readme


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/commit/c00a7c4b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/tree/c00a7c4b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/diff/c00a7c4b

Branch: refs/heads/master
Commit: c00a7c4b8546694b8fd96f119a2c845bc13e2c71
Parents: 86a9c81
Author: maverickmishra <vishalmishra0907@gmail.com>
Authored: Tue Aug 30 17:11:10 2016 -0700
Committer: maverickmishra <vishalmishra0907@gmail.com>
Committed: Tue Aug 30 17:11:10 2016 -0700

----------------------------------------------------------------------
 README.md                       | 32 ++++++--------------------------
 src/android/CDVOrientation.java |  5 ++---
 www/screenorientation.js        | 10 +++++-----
 3 files changed, 13 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/c00a7c4b/README.md
----------------------------------------------------------------------
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
 

http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/c00a7c4b/src/android/CDVOrientation.java
----------------------------------------------------------------------
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);

http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/c00a7c4b/www/screenorientation.js
----------------------------------------------------------------------
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;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message