This repository was archived by the owner on Apr 2, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -33,16 +33,16 @@ public void onGlobalLayout() {
3333 rootView .getWindowVisibleDisplayFrame (r );
3434
3535 int heightDiff = rootView .getRootView ().getHeight () - (r .bottom - r .top );
36- if ( heightDiff > 200 && heightDiff != previousHeightDiff ) { // if more than 200 pixels, its probably a keyboard...
37- int keyboardHeight = ( int )( heightDiff / density );
36+ int pixelHeightDiff = ( int )( heightDiff / density );
37+ if ( pixelHeightDiff > 100 && pixelHeightDiff != previousHeightDiff ) { // if more than 100 pixels, its probably a keyboard...
3838 appView .sendJavascript ("cordova.plugins.Keyboard.isVisible = true" );
39- appView .sendJavascript ("cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight':" + Integer .toString (keyboardHeight )+"});" );
39+ appView .sendJavascript ("cordova.fireWindowEvent('native.showkeyboard', { 'keyboardHeight':" + Integer .toString (pixelHeightDiff )+"});" );
4040 }
41- else if ( heightDiff != previousHeightDiff && ( previousHeightDiff - heightDiff ) > 200 ){
41+ else if ( pixelHeightDiff != previousHeightDiff && ( previousHeightDiff - pixelHeightDiff ) > 100 ){
4242 appView .sendJavascript ("cordova.plugins.Keyboard.isVisible = false" );
4343 appView .sendJavascript ("cordova.fireWindowEvent('native.hidekeyboard')" );
4444 }
45- previousHeightDiff = heightDiff ;
45+ previousHeightDiff = pixelHeightDiff ;
4646 }
4747 };
4848
You can’t perform that action at this time.
0 commit comments