cordova-plugin-mserviceinterface-2.0 1.0.34 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-mserviceinterface-2.0",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "This plugin establishes the connection to the native interface and performs the requested task.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/plugin.xml CHANGED
@@ -2,7 +2,7 @@
2
2
  <plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
3
3
  xmlns:android="http://schemas.android.com/apk/res/android"
4
4
  id="cordova-plugin-mserviceinterface-2.0"
5
- version="1.0.34">
5
+ version="1.0.35">
6
6
  <name>mserviceinterface-2.0</name>
7
7
  <description>This plugin establishes the connection to the native interface and performs the requested task.</description>
8
8
  <author>selfservit@gmail.com</author>
@@ -15,6 +15,7 @@ import android.content.IntentSender;
15
15
  import android.content.pm.ActivityInfo;
16
16
  import android.content.pm.ApplicationInfo;
17
17
  import android.content.pm.PackageManager;
18
+ import android.content.res.Configuration;
18
19
  import android.database.Cursor;
19
20
  import android.graphics.Bitmap;
20
21
  import android.graphics.BitmapFactory;
@@ -1508,7 +1509,14 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
1508
1509
  //Rotate Screen plugin
1509
1510
  public void rotateScreen(JSONArray args, CallbackContext callbackContext) {
1510
1511
  String orientation = args.optString(0);
1512
+ String currentOrientation = "";
1511
1513
  Activity activity = cordova.getActivity();
1514
+ int orientation1 = activity.getResources().getConfiguration().orientation;
1515
+ if (orientation1 == Configuration.ORIENTATION_LANDSCAPE) {
1516
+ currentOrientation = "landscape";
1517
+ } else {
1518
+ currentOrientation = "portrait";
1519
+ };
1512
1520
  if (orientation.equals(ANY)) {
1513
1521
  activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
1514
1522
  } else if (orientation.equals(LANDSCAPE_PRIMARY)) {
@@ -1524,7 +1532,7 @@ public class mInterface extends CordovaPlugin implements com.google.android.gms.
1524
1532
  } else if (orientation.equals(PORTRAIT_SECONDARY)) {
1525
1533
  activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT);
1526
1534
  }
1527
- callbackContext.success();
1535
+ callbackContext.success(currentOrientation);
1528
1536
  }
1529
1537
 
1530
1538
  public void deviceInfo(CallbackContext callbackContext) throws JSONException {