@@ -0,0 +1,3696 @@
+/*%0A *%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A *%0A */%0A%0Apackage cordova.plugins.screenorientation;%0A%0Aimport org.apache.cordova.CallbackContext;%0Aimport org.apache.cordova.CordovaPlugin;%0A%0Aimport org.json.JSONArray;%0Aimport org.json.JSONException;%0A%0Aimport android.app.Activity;%0Aimport android.content.pm.ActivityInfo;%0Aimport android.util.Log;%0A%0Apublic class CDVOrientation extends CordovaPlugin %7B%0A    %0A    private static final String TAG = %22YoikScreenOrientation%22; %0A    %0A    /**%0A     * Screen Orientation Constants%0A     */%0A    %0A    private static final String ANY = %22any%22;%0A    private static final String PORTRAIT_PRIMARY = %22portrait-primary%22;%0A    private static final String PORTRAIT_SECONDARY = %22portrait-secondary%22;%0A    private static final String LANDSCAPE_PRIMARY = %22landscape-primary%22;%0A    private static final String LANDSCAPE_SECONDARY = %22landscape-secondary%22;%0A    private static final String PORTRAIT = %22portrait%22;%0A    private static final String LANDSCAPE = %22landscape%22;%0A    %0A    @Override%0A    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) %7B%0A        %0A        Log.d(TAG, %22execute action: %22 + action);%0A        %0A        // Route the Action%0A        if (action.equals(%22screenOrientation%22)) %7B%0A            return routeScreenOrientation(args, callbackContext);%0A        %7D%0A        %0A        // Action not found%0A        callbackContext.error(%22action not recognised%22);%0A        return false;%0A    %7D%0A    %0A    private boolean routeScreenOrientation(JSONArray args, CallbackContext callbackContext) %7B%0A        %0A        String action = args.optString(0);%0A        %0A        %0A        %0A        String orientation = args.optString(1);%0A        %0A        Log.d(TAG, %22Requested ScreenOrientation: %22 + orientation);%0A        %0A        Activity activity = cordova.getActivity();%0A        %0A        if (orientation.equals(ANY)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);%0A        %7D else if (orientation.equals(LANDSCAPE_PRIMARY)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);%0A        %7D else if (orientation.equals(PORTRAIT_PRIMARY)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);%0A        %7D else if (orientation.equals(LANDSCAPE)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);%0A        %7D else if (orientation.equals(PORTRAIT)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);%0A        %7D else if (orientation.equals(LANDSCAPE_SECONDARY)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE);%0A        %7D else if (orientation.equals(PORTRAIT_SECONDARY)) %7B%0A            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);%0A        %7D%0A        %0A        callbackContext.success();%0A        return true;%0A        %0A        %0A    %7D%0A%7D%0A

Create CDVOrientation.java