Skip to content

Commit

Permalink
fix virtual keyboard size with and without statusbar
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandopg committed Feb 25, 2015
1 parent 39fa075 commit 73a6d27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.DS_Store
*.sw[mnpcod]
*.sw[mnpcod]
2 changes: 1 addition & 1 deletion src/android/IonicKeyboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void onGlobalLayout() {
//r will be populated with the coordinates of your view that area still visible.
rootView.getWindowVisibleDisplayFrame(r);

int heightDiff = rootView.getRootView().getHeight() - (r.bottom - r.top);
int heightDiff = rootView.getRootView().getHeight() - (r.bottom);
int pixelHeightDiff = (int)(heightDiff / density);
if (pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff) { // if more than 100 pixels, its probably a keyboard...
appView.sendJavascript("cordova.plugins.Keyboard.isVisible = true");
Expand Down

0 comments on commit 73a6d27

Please sign in to comment.