summaryrefslogtreecommitdiff
path: root/plugins/com.phonegap.plugins.OrientationLock/README.md
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-07-24 15:48:01 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-07-24 15:48:01 -0400
commit83400033a3b7a91ad072a5d306355c9cd5a80d82 (patch)
treeb84d23a607523249554dc97ed26f000ca03d0abd /plugins/com.phonegap.plugins.OrientationLock/README.md
parent89640e9b0212a2525ea132b1d11bb8962f5444dd (diff)
integrated event scrubbing with direct image access - need to clean up code
Diffstat (limited to 'plugins/com.phonegap.plugins.OrientationLock/README.md')
-rw-r--r--plugins/com.phonegap.plugins.OrientationLock/README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/plugins/com.phonegap.plugins.OrientationLock/README.md b/plugins/com.phonegap.plugins.OrientationLock/README.md
new file mode 100644
index 00000000..6a5899ed
--- /dev/null
+++ b/plugins/com.phonegap.plugins.OrientationLock/README.md
@@ -0,0 +1,29 @@
+# OrientationLock #
+
+Android Cordova plugin for locking/unlocking the screen orientation from Javascript
+
+## Calling the plugin ##
+
+From your JavaScript code call
+`window.plugins.orientationLock.unlock()` to unlock orientation,
+`window.plugins.orientationLock.lock("portrait")` or `window.plugins.orientationLock.lock("landscape")`
+to lock your screen to the specified orientation.
+
+To start your Cordova application pre-locked place
+`setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);` or
+`setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);`
+in the `onCreate()` of your Cordova activity.
+
+Once unlocked, you can track orientation changes with the regular `orientationchange` event:
+
+ window.addEventListener("orientationchange", function() {
+ alert(window.orientation);
+ });
+
+## Adding the Plugin to your project ##
+
+Using this plugin requires [Apache Cordova for Android](https://github.com/apache/cordova-android).
+Within your project, run the following command:
+
+ cordova plugin add https://github.com/cogitor/PhoneGap-OrientationLock.git
+