Hi!
Can anyone help me implement this function using Inline JAVA?
Resources:
https://developer.android.com/refer...l#getRealMetrics(android.util.DisplayMetrics)
http://stackoverflow.com/questions/...ht-of-the-status-bar-and-soft-key-buttons-bar
Many, many thanks in advance!
Can anyone help me implement this function using Inline JAVA?
B4X:
@SuppressLint("NewApi")
private int getSoftButtonsBarHeight() {
// getRealMetrics is only available with API 17 and +
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int usableHeight = metrics.heightPixels;
getWindowManager().getDefaultDisplay().getRealMetrics(metrics);
int realHeight = metrics.heightPixels;
if (realHeight > usableHeight)
return realHeight - usableHeight;
else
return 0;
}
return 0;
}
Resources:
https://developer.android.com/refer...l#getRealMetrics(android.util.DisplayMetrics)
http://stackoverflow.com/questions/...ht-of-the-status-bar-and-soft-key-buttons-bar
Many, many thanks in advance!