remove cordova-plugin-console and ionic-plugin-keyboard plugins issue #72

This commit is contained in:
Morgan McMillian 2018-09-02 16:55:16 -07:00
parent 10bc57a281
commit c25177f758
6 changed files with 0 additions and 171 deletions

View file

@ -87,7 +87,6 @@
<allow-navigation href="http://10.0.0.212:8100" /> <allow-navigation href="http://10.0.0.212:8100" />
<plugin name="cordova-plugin-filechooser" spec="^1.0.1" /> <plugin name="cordova-plugin-filechooser" spec="^1.0.1" />
<plugin name="cordova-plugin-share-content" spec="^1.0.0" /> <plugin name="cordova-plugin-share-content" spec="^1.0.0" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-file" spec="^6.0.1" /> <plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" /> <plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="com-darryncampbell-cordova-plugin-intent" spec="0.0.19" /> <plugin name="com-darryncampbell-cordova-plugin-intent" spec="0.0.19" />
@ -96,7 +95,6 @@
<plugin name="cordova-plugin-statusbar" spec="^2.4.1" /> <plugin name="cordova-plugin-statusbar" spec="^2.4.1" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" /> <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-device" spec="^2.0.1" /> <plugin name="cordova-plugin-device" spec="^2.0.1" />
<plugin name="cordova-plugin-console" spec="^1.1.0" />
<plugin name="cordova-android-support-gradle-release" spec="^1.4.2"> <plugin name="cordova-android-support-gradle-release" spec="^1.4.2">
<variable name="ANDROID_SUPPORT_VERSION" value="27.+" /> <variable name="ANDROID_SUPPORT_VERSION" value="27.+" />
</plugin> </plugin>

10
package-lock.json generated
View file

@ -2363,11 +2363,6 @@
"xml2js": "0.4.19" "xml2js": "0.4.19"
} }
}, },
"cordova-plugin-console": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/cordova-plugin-console/-/cordova-plugin-console-1.1.0.tgz",
"integrity": "sha1-4vusECkBeeRMtyxf28QQpTHBzW0="
},
"cordova-plugin-device": { "cordova-plugin-device": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz", "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz",
@ -4659,11 +4654,6 @@
"resolved": "https://registry.npmjs.org/ionic-angular/-/ionic-angular-3.9.2.tgz", "resolved": "https://registry.npmjs.org/ionic-angular/-/ionic-angular-3.9.2.tgz",
"integrity": "sha512-BEZ6magY1i5GwM9ki/MOpszUz62+g518HsGICtw9TE1D4v9Eb6n/o7e+X0vtvpK4TdouFjQ8r5XA9VPAKW9/+Q==" "integrity": "sha512-BEZ6magY1i5GwM9ki/MOpszUz62+g518HsGICtw9TE1D4v9Eb6n/o7e+X0vtvpK4TdouFjQ8r5XA9VPAKW9/+Q=="
}, },
"ionic-plugin-keyboard": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/ionic-plugin-keyboard/-/ionic-plugin-keyboard-2.2.1.tgz",
"integrity": "sha1-8qnhabvptVIkADR8n9bTRn7j+hI="
},
"ionicons": { "ionicons": {
"version": "4.2.4", "version": "4.2.4",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-4.2.4.tgz", "resolved": "https://registry.npmjs.org/ionicons/-/ionicons-4.2.4.tgz",

View file

@ -32,7 +32,6 @@
"com-darryncampbell-cordova-plugin-intent": "^1.1.0", "com-darryncampbell-cordova-plugin-intent": "^1.1.0",
"cordova-android": "7.1.0", "cordova-android": "7.1.0",
"cordova-android-support-gradle-release": "^1.4.4", "cordova-android-support-gradle-release": "^1.4.4",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^2.0.2", "cordova-plugin-device": "^2.0.2",
"cordova-plugin-file": "^6.0.1", "cordova-plugin-file": "^6.0.1",
"cordova-plugin-file-transfer": "^1.7.1", "cordova-plugin-file-transfer": "^1.7.1",
@ -45,7 +44,6 @@
"cordova-plugin-telerik-imagepicker": "^2.1.8", "cordova-plugin-telerik-imagepicker": "^2.1.8",
"cordova-plugin-whitelist": "^1.3.3", "cordova-plugin-whitelist": "^1.3.3",
"ionic-angular": "3.9.2", "ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "4.2.4", "ionicons": "4.2.4",
"moment": "^2.18.1", "moment": "^2.18.1",
"ng2-cordova-oauth": "0.0.8", "ng2-cordova-oauth": "0.0.8",
@ -63,7 +61,6 @@
"description": "An Ionic project", "description": "An Ionic project",
"cordova": { "cordova": {
"plugins": { "plugins": {
"ionic-plugin-keyboard": {},
"cordova-plugin-share-content": {}, "cordova-plugin-share-content": {},
"cordova-plugin-filechooser": {}, "cordova-plugin-filechooser": {},
"cordova-plugin-file": {}, "cordova-plugin-file": {},
@ -74,7 +71,6 @@
"cordova-plugin-statusbar": {}, "cordova-plugin-statusbar": {},
"cordova-plugin-splashscreen": {}, "cordova-plugin-splashscreen": {},
"cordova-plugin-device": {}, "cordova-plugin-device": {},
"cordova-plugin-console": {},
"cordova-android-support-gradle-release": { "cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+" "ANDROID_SUPPORT_VERSION": "27.+"
}, },

View file

@ -14,10 +14,6 @@
} }
], ],
"/*": [ "/*": [
{
"xml": "<feature name=\"Keyboard\"><param name=\"android-package\" value=\"io.ionic.keyboard.IonicKeyboard\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1
},
{ {
"xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>", "xml": "<feature name=\"File\"><param name=\"android-package\" value=\"org.apache.cordova.file.FileUtils\" /><param name=\"onload\" value=\"true\" /></feature>",
"count": 1 "count": 1
@ -116,9 +112,6 @@
"cordova-plugin-share-content": { "cordova-plugin-share-content": {
"PACKAGE_NAME": "com.monkeystew.goober_m" "PACKAGE_NAME": "com.monkeystew.goober_m"
}, },
"ionic-plugin-keyboard": {
"PACKAGE_NAME": "com.monkeystew.goober_m"
},
"cordova-plugin-file": { "cordova-plugin-file": {
"PACKAGE_NAME": "com.monkeystew.goober_m" "PACKAGE_NAME": "com.monkeystew.goober_m"
}, },
@ -143,9 +136,6 @@
"cordova-plugin-device": { "cordova-plugin-device": {
"PACKAGE_NAME": "com.monkeystew.goober_m" "PACKAGE_NAME": "com.monkeystew.goober_m"
}, },
"cordova-plugin-console": {
"PACKAGE_NAME": "com.monkeystew.goober_m"
},
"cordova-android-support-gradle-release": { "cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+", "ANDROID_SUPPORT_VERSION": "27.+",
"PACKAGE_NAME": "com.monkeystew.goober_m" "PACKAGE_NAME": "com.monkeystew.goober_m"
@ -172,15 +162,6 @@
"shareContentPlugin" "shareContentPlugin"
] ]
}, },
{
"id": "ionic-plugin-keyboard.keyboard",
"file": "plugins/ionic-plugin-keyboard/www/android/keyboard.js",
"pluginId": "ionic-plugin-keyboard",
"clobbers": [
"cordova.plugins.Keyboard"
],
"runs": true
},
{ {
"id": "cordova-plugin-file.DirectoryEntry", "id": "cordova-plugin-file.DirectoryEntry",
"file": "plugins/cordova-plugin-file/www/DirectoryEntry.js", "file": "plugins/cordova-plugin-file/www/DirectoryEntry.js",
@ -423,7 +404,6 @@
"plugin_metadata": { "plugin_metadata": {
"cordova-plugin-filechooser": "1.0.1", "cordova-plugin-filechooser": "1.0.1",
"cordova-plugin-share-content": "1.0.0", "cordova-plugin-share-content": "1.0.0",
"ionic-plugin-keyboard": "2.2.1",
"cordova-plugin-file": "6.0.1", "cordova-plugin-file": "6.0.1",
"cordova-plugin-file-transfer": "1.7.1", "cordova-plugin-file-transfer": "1.7.1",
"com-darryncampbell-cordova-plugin-intent": "1.1.0", "com-darryncampbell-cordova-plugin-intent": "1.1.0",
@ -432,7 +412,6 @@
"cordova-plugin-statusbar": "2.4.2", "cordova-plugin-statusbar": "2.4.2",
"cordova-plugin-splashscreen": "5.0.2", "cordova-plugin-splashscreen": "5.0.2",
"cordova-plugin-device": "2.0.2", "cordova-plugin-device": "2.0.2",
"cordova-plugin-console": "1.1.0",
"cordova-android-support-gradle-release": "1.4.4", "cordova-android-support-gradle-release": "1.4.4",
"cordova-plugin-filepath": "1.4.2" "cordova-plugin-filepath": "1.4.2"
} }

View file

@ -1,130 +0,0 @@
package io.ionic.keyboard;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.apache.cordova.PluginResult;
import org.apache.cordova.PluginResult.Status;
import org.json.JSONArray;
import org.json.JSONException;
import android.content.Context;
import android.graphics.Rect;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.ViewTreeObserver.OnGlobalLayoutListener;
import android.view.inputmethod.InputMethodManager;
// import additionally required classes for calculating screen height
import android.view.Display;
import android.graphics.Point;
import android.os.Build;
public class IonicKeyboard extends CordovaPlugin {
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
super.initialize(cordova, webView);
}
public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
if ("close".equals(action)) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
//http://stackoverflow.com/a/7696791/1091751
InputMethodManager inputManager = (InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
View v = cordova.getActivity().getCurrentFocus();
if (v == null) {
callbackContext.error("No current focus");
} else {
inputManager.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
callbackContext.success(); // Thread-safe.
}
}
});
return true;
}
if ("show".equals(action)) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
((InputMethodManager) cordova.getActivity().getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(0, InputMethodManager.HIDE_IMPLICIT_ONLY);
callbackContext.success(); // Thread-safe.
}
});
return true;
}
if ("init".equals(action)) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
//calculate density-independent pixels (dp)
//http://developer.android.com/guide/practices/screens_support.html
DisplayMetrics dm = new DisplayMetrics();
cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
final float density = dm.density;
//http://stackoverflow.com/a/4737265/1091751 detect if keyboard is showing
final View rootView = cordova.getActivity().getWindow().getDecorView().findViewById(android.R.id.content).getRootView();
OnGlobalLayoutListener list = new OnGlobalLayoutListener() {
int previousHeightDiff = 0;
@Override
public void onGlobalLayout() {
Rect r = new Rect();
//r will be populated with the coordinates of your view that area still visible.
rootView.getWindowVisibleDisplayFrame(r);
PluginResult result;
// cache properties for later use
int rootViewHeight = rootView.getRootView().getHeight();
int resultBottom = r.bottom;
// calculate screen height differently for android versions >= 21: Lollipop 5.x, Marshmallow 6.x
//http://stackoverflow.com/a/29257533/3642890 beware of nexus 5
int screenHeight;
if (Build.VERSION.SDK_INT >= 21) {
Display display = cordova.getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
screenHeight = size.y;
} else {
screenHeight = rootViewHeight;
}
int heightDiff = screenHeight - resultBottom;
int pixelHeightDiff = (int)(heightDiff / density);
if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard...
String msg = "S" + Integer.toString(pixelHeightDiff);
result = new PluginResult(PluginResult.Status.OK, msg);
result.setKeepCallback(true);
callbackContext.sendPluginResult(result);
}
else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelHeightDiff ) > 100 ){
String msg = "H";
result = new PluginResult(PluginResult.Status.OK, msg);
result.setKeepCallback(true);
callbackContext.sendPluginResult(result);
}
previousHeightDiff = pixelHeightDiff;
}
};
rootView.getViewTreeObserver().addOnGlobalLayoutListener(list);
PluginResult dataResult = new PluginResult(PluginResult.Status.OK);
dataResult.setKeepCallback(true);
callbackContext.sendPluginResult(dataResult);
}
});
return true;
}
return false; // Returning false results in a "MethodNotFound" error.
}
}

View file

@ -3,10 +3,6 @@
<feature name="FileChooser"> <feature name="FileChooser">
<param name="android-package" value="com.megster.cordova.FileChooser" /> <param name="android-package" value="com.megster.cordova.FileChooser" />
</feature> </feature>
<feature name="Keyboard">
<param name="android-package" value="io.ionic.keyboard.IonicKeyboard" />
<param name="onload" value="true" />
</feature>
<feature name="File"> <feature name="File">
<param name="android-package" value="org.apache.cordova.file.FileUtils" /> <param name="android-package" value="org.apache.cordova.file.FileUtils" />
<param name="onload" value="true" /> <param name="onload" value="true" />