Merge branch 'revert-33798ee5' into 'master'

Revert "Merge branch 'bugfix/VNQ-7319-fix-keyboard-height' into 'master'"

See merge request qt/qtandroidextensions!94
parents ad8ca5d6 764af1af
......@@ -45,8 +45,6 @@ import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager.LayoutParams;
import android.widget.PopupWindow;
import android.util.DisplayMetrics;
import android.view.Display;
/*
......@@ -108,53 +106,13 @@ public class KeyboardHeightProvider
{
try
{
//Getting dsiplay size
//https://stackoverflow.com/questions/1016896/get-screen-dimensions-in-pixels/15699681#15699681
Point screenSize = new Point();
Display d = mActivity.getWindowManager().getDefaultDisplay();
d.getSize(screenSize);
int heightPixels = screenSize.y;
try
{
DisplayMetrics metrics = new DisplayMetrics();
d.getMetrics(metrics);
heightPixels = metrics.heightPixels;
}
catch(final Throwable e)
{
Log.e(TAG, "onGlobalLayout exception (1): " + e);
}
if (android.os.Build.VERSION.SDK_INT >= 14 && android.os.Build.VERSION.SDK_INT < 17) {
try
{
heightPixels = (Integer) Display.class.getMethod("getRawHeight").invoke(d);
}
catch(final Throwable e)
{
Log.e(TAG, "onGlobalLayout exception (2): " + e);
}
}
if (android.os.Build.VERSION.SDK_INT >= 17) {
try
{
Point realSize = new Point();
Display.class.getMethod("getRealSize", Point.class).invoke(d, realSize);
heightPixels = realSize.y;
}
catch(final Throwable e)
{
Log.e(TAG, "onGlobalLayout exception (3): " + e);
}
}
mActivity.getWindowManager().getDefaultDisplay().getSize(screenSize);
Rect rect = new Rect();
mPopupView.getWindowVisibleDisplayFrame(rect);
int keyboardHeight = heightPixels - rect.bottom;
int keyboardHeight = screenSize.y - rect.bottom;
// keyboardHeight can be negative, when navigation panel is hided
// screenSize doesn't take into account the possibility of hiding panel
if (keyboardHeight < 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment