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

Commit 00e2fd1

Browse files
author
twilly86
committed
android keyboard height bug fix, density incorrect
In testing with galaxy s2, the keyboard height was not being calculated correctly. I found out the density was being set to an int. From here.. http://stackoverflow.com/questions/3166501/getting-the-screen-density-programmatically-in-android Density can be .75, 1, 1.5, 2, ect. thus it was being rounded to the nearest integer and causing the incorrect keyboard height. I switched it to be a float
1 parent b1436e3 commit 00e2fd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/android/IonicKeyboard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void initialize(CordovaInterface cordova, CordovaWebView webView) {
1818
//http://developer.android.com/guide/practices/screens_support.html
1919
DisplayMetrics dm = new DisplayMetrics();
2020
cordova.getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
21-
final int density = (int)(dm.density);
21+
final float density = (float)(dm.density);
2222

2323
final CordovaWebView appView = webView;
2424

0 commit comments

Comments
 (0)