Permalink
Browse files

updated plugin.xml removed blank lines and fixed xml + added

ThreadSave method calls to SoftKeyboard.java to avoid blocking the
WebCore Thread
  • Loading branch information...
1 parent 4ecd712 commit 68621e883193cef54e2568034103cf5c0486e219 Tobias Brunkhorst committed Oct 15, 2013
Showing with 19 additions and 9 deletions.
  1. +2 −4 plugin.xml
  2. +17 −5 src/android/de/phonostar/SoftKeyboard.java
View
@@ -9,12 +9,10 @@
<license>MIT</license>
<author>phonostar GmbH</author>
-
<engines>
<engine name="cordova" version=">=3.0.0"/>
</engines>
- <!-- <asset src="www/softkeyboard.js" target="js/plugins/softkeyboard.js"/> -->
<js-module src="www/softkeyboard.js" name="SoftKeyboard">
<clobbers target="SoftKeyboard" />
</js-module>
@@ -23,10 +21,10 @@
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="SoftKeyboard">
- <param name="android-package" value="de.phonostar.SoftKeyboard"/>
+ <param name="android-package" value="de.phonostar.SoftKeyboard" />
</feature>
</config-file>
- <source-file src="src/android/de/phonostar/SoftKeyboard.java" target-dir="src/de/phonostar"/>
+ <source-file src="src/android/de/phonostar/SoftKeyboard.java" target-dir="src/de/phonostar" />
</platform>
</plugin>
@@ -33,17 +33,29 @@ public boolean isKeyBoardShowing() {
@Override
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
if (action.equals("show")) {
- this.showKeyBoard();
- callbackContext.success("done");
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ this.showKeyBoard();
+ callbackContext.success("done");
+ }
+ });
return true;
}
else if (action.equals("hide")) {
- this.hideKeyBoard();
- callbackContext.success();
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ this.hideKeyBoard();
+ callbackContext.success();
+ }
+ });
return true;
}
else if (action.equals("isShowing")) {
- callbackContext.success(Boolean.toString(this.isKeyBoardShowing()));
+ cordova.getActivity().runOnUiThread(new Runnable() {
+ public void run() {
+ callbackContext.success(Boolean.toString(this.isKeyBoardShowing()));
+ }
+ });
return true;
}
else {

0 comments on commit 68621e8

Please sign in to comment.