From 02811010cf62f1b21a06780d1e470d04bb24c50f Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Sat, 31 Oct 2015 08:21:38 -0400 Subject: removed unecessary files from git --- .../src/com/plugin/phonegap/OrientationLock.java | 65 ---------------------- 1 file changed, 65 deletions(-) delete mode 100644 plugins/com.phonegap.plugins.OrientationLock/src/com/plugin/phonegap/OrientationLock.java (limited to 'plugins/com.phonegap.plugins.OrientationLock/src/com/plugin') diff --git a/plugins/com.phonegap.plugins.OrientationLock/src/com/plugin/phonegap/OrientationLock.java b/plugins/com.phonegap.plugins.OrientationLock/src/com/plugin/phonegap/OrientationLock.java deleted file mode 100644 index 063fb900..00000000 --- a/plugins/com.phonegap.plugins.OrientationLock/src/com/plugin/phonegap/OrientationLock.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.plugin.phonegap; - -import org.json.JSONArray; -import org.json.JSONException; - -import android.content.pm.ActivityInfo; - -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaInterface; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.CordovaWebView; - -/** - * - * Android Phonegap Plugin for locking/unlocking the orientation from JS code - * - */ -public class OrientationLock extends CordovaPlugin { - - private static final String LANSCAPE = "landscape"; - private static final String PORTRAIT = "portrait"; - - public OrientationLock() { - } - - public void unlock() { - this.cordova.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); - } - - public void lock(String orientation) { - if (orientation.equals(PORTRAIT)) - this.cordova.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - else - this.cordova.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } - - @Override - public boolean execute(String action, JSONArray arguments, CallbackContext callbackContext) { - if (action.equals("lock")) { - - try { - String orientation = arguments.getString(0); - - if (orientation!=null && (orientation.equals(LANSCAPE) || orientation.equals(PORTRAIT))) { - this.lock(orientation); - callbackContext.success(); - return true; - } else { - return false; - } - } catch (JSONException e) { - callbackContext.error("JSON_EXCEPTION"); - return true; - } - - } else if (action.equals("unlock")) { - this.unlock(); - callbackContext.success(); - return true; - - } else { - return false; - } - } -} -- cgit v1.2.3