edge-to-edge: Set setDecorFitsSystemWindows(false)

This commit is contained in:
Jules Aguillon 2025-03-22 23:05:19 +01:00
parent 1d6a115ce4
commit 52d596ded2
2 changed files with 2 additions and 15 deletions

View File

@ -304,6 +304,7 @@ public class Keyboard2 extends InputMethodService
WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
// Allow to draw behind system bars
wattrs.setFitInsetsTypes(0);
window.setDecorFitsSystemWindows(false);
}
updateLayoutHeightOf(window, ViewGroup.LayoutParams.MATCH_PARENT);
final View inputArea = window.findViewById(android.R.id.inputArea);

View File

@ -282,21 +282,7 @@ public class Keyboard2View extends View
Insets insets = wi.getInsets(insets_types);
insets_left = insets.left;
insets_right = insets.right;
// On API 35, the keyboard is allowed to draw under the
// button-navigation bar but on lower APIs, it must be discounted from
// the width.
if (VERSION.SDK_INT < 35)
{
Insets nav_insets = wi.getInsets(WindowInsets.Type.navigationBars());
width -= nav_insets.left + nav_insets.right;
insets_left -= nav_insets.left;
insets_right -= nav_insets.right;
}
// [insets.bottom] doesn't take into account the buttons that appear in
// the gesture navigation bar when the IME is showing so ensure a minimum
// of margin is added.
if (VERSION.SDK_INT >= 35)
insets_bottom = Math.max(insets.bottom, _config.bottomInsetMin);
insets_bottom = Math.max(insets.bottom, _config.bottomInsetMin);
}
else
{