Skip to content
This repository was archived by the owner on Apr 2, 2018. It is now read-only.

Commit e6f0713

Browse files
committed
fix formatting
1 parent 15c1206 commit e6f0713

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/android/IonicKeyboard.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public class IonicKeyboard extends CordovaPlugin{
1313

14-
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
14+
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
1515
super.initialize(cordova, webView);
1616

1717
//calculate density-independent pixels (dp)
@@ -25,7 +25,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
2525
//http://stackoverflow.com/a/4737265/1091751 detect if keyboard is showing
2626
final View rootView = cordova.getActivity().getWindow().getDecorView().findViewById(android.R.id.content).getRootView();
2727
OnGlobalLayoutListener list = new OnGlobalLayoutListener() {
28-
int previousHeightDiff = 0;
28+
int previousHeightDiff = 0;
2929
@Override
3030
public void onGlobalLayout() {
3131
Rect r = new Rect();
@@ -34,13 +34,13 @@ public void onGlobalLayout() {
3434

3535
int heightDiff = rootView.getRootView().getHeight() - (r.bottom - r.top);
3636
if (heightDiff > 200 && heightDiff != previousHeightDiff) { // if more than 200 pixels, its probably a keyboard...
37-
int keyboardHeight = (int)(heightDiff / density);
38-
appView.sendJavascript("cordova.plugins.Keyboard.isVisible = true");
39-
appView.sendJavascript("cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight':" + Integer.toString(keyboardHeight)+"});");
37+
int keyboardHeight = (int)(heightDiff / density);
38+
appView.sendJavascript("cordova.plugins.Keyboard.isVisible = true");
39+
appView.sendJavascript("cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight':" + Integer.toString(keyboardHeight)+"});");
4040
}
41-
else if (heightDiff != previousHeightDiff && (previousHeightDiff - heightDiff) > 200){
42-
appView.sendJavascript("cordova.plugins.Keyboard.isVisible = false");
43-
appView.sendJavascript("cordova.fireWindowEvent('native.hidekeyboard')");
41+
else if ( heightDiff != previousHeightDiff && ( previousHeightDiff - heightDiff ) > 200 ){
42+
appView.sendJavascript("cordova.plugins.Keyboard.isVisible = false");
43+
appView.sendJavascript("cordova.fireWindowEvent('native.hidekeyboard')");
4444
}
4545
previousHeightDiff = heightDiff;
4646
}

0 commit comments

Comments
 (0)