Skip to content

Commit

Permalink
fix(android): Avoid conflicts when ionic-plugin-keyboard is installed (
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Aug 21, 2019
1 parent 659d402 commit 893dc8e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</js-module>

<config-file target="config.xml" parent="/*">
<feature name="Keyboard">
<feature name="CDVIonicKeyboard">
<param name="ios-package" value="CDVIonicKeyboard" onload="true"/>
</feature>
</config-file>
Expand All @@ -36,12 +36,12 @@
<clobbers target="window.Keyboard"/>
</js-module>
<config-file target="config.xml" parent="/*">
<feature name="Keyboard">
<param name="android-package" value="io.ionic.keyboard.IonicKeyboard" onload="true"/>
<feature name="CDVIonicKeyboard">
<param name="android-package" value="io.ionic.keyboard.CDVIonicKeyboard" onload="true"/>
</feature>
</config-file>

<source-file src="src/android/IonicKeyboard.java" target-dir="src/io/ionic/keyboard"/>
<source-file src="src/android/CDVIonicKeyboard.java" target-dir="src/io/ionic/keyboard"/>
</platform>

</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import android.graphics.Point;
import android.os.Build;

public class IonicKeyboard extends CordovaPlugin {
public class CDVIonicKeyboard extends CordovaPlugin {
private OnGlobalLayoutListener list;
private View rootView;

Expand Down
6 changes: 3 additions & 3 deletions www/android/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ Keyboard.hideFormAccessoryBar = Keyboard.hideKeyboardAccessoryBar = function (hi
};

Keyboard.hide = function () {
exec(null, null, "Keyboard", "hide", []);
exec(null, null, "CDVIonicKeyboard", "hide", []);
};

Keyboard.show = function () {
exec(null, null, "Keyboard", "show", []);
exec(null, null, "CDVIonicKeyboard", "show", []);
};

Keyboard.disableScroll = function (disable) {
Expand All @@ -62,7 +62,7 @@ Keyboard.setKeyboardStyle = function(style) {
};

channel.onCordovaReady.subscribe(function () {
exec(success, null, 'Keyboard', 'init', []);
exec(success, null, 'CDVIonicKeyboard', 'init', []);

function success(msg) {
var action = msg.charAt(0);
Expand Down
12 changes: 6 additions & 6 deletions www/ios/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ Keyboard.fireOnResize = function (height, screenHeight, ele) {

Keyboard.hideFormAccessoryBar = function (hide, success) {
if (hide !== null && hide !== undefined) {
exec(success, null, "Keyboard", "hideFormAccessoryBar", [hide]);
exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", [hide]);
} else {
exec(success, null, "Keyboard", "hideFormAccessoryBar", []);
exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", []);
}
};

Keyboard.hide = function () {
exec(null, null, "Keyboard", "hide", []);
exec(null, null, "CDVIonicKeyboard", "hide", []);
};

Keyboard.show = function () {
Expand All @@ -87,15 +87,15 @@ Keyboard.show = function () {
};

Keyboard.disableScroll = function (disable) {
exec(null, null, "Keyboard", "disableScroll", [disable]);
exec(null, null, "CDVIonicKeyboard", "disableScroll", [disable]);
};

Keyboard.setResizeMode = function (mode) {
exec(null, null, "Keyboard", "setResizeMode", [mode]);
exec(null, null, "CDVIonicKeyboard", "setResizeMode", [mode]);
}

Keyboard.setKeyboardStyle = function(style) {
exec(null, null, "Keyboard", "keyboardStyle", [style]);
exec(null, null, "CDVIonicKeyboard", "keyboardStyle", [style]);
};

Keyboard.isVisible = false;
Expand Down

0 comments on commit 893dc8e

Please sign in to comment.