Compare commits

...

3 Commits

Author SHA1 Message Date
Jules Aguillon
ea78c2ae5e Take all system bars into account
Some checks failed
Make Apk CI / Build-Apk (push) Has been cancelled
Check translations / check-translations (push) Has been cancelled
Check layouts / check_layout.output (push) Has been cancelled
Check layouts / Generated files (push) Has been cancelled
This doesn't change anything now but might in the future.
2025-06-29 15:08:52 +02:00
Jules Aguillon
e6019a179d Remove dead code 2025-06-29 12:23:37 +02:00
Jules Aguillon
2d847e53ec edge-to-edge: Set setDecorFitsSystemWindows(false)
This fixes the unwanted margin at the bottom of the screen on
Samsung One UI 7 based on Android 15.
2025-06-29 12:22:54 +02:00
2 changed files with 4 additions and 18 deletions

View File

@@ -315,6 +315,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

@@ -277,27 +277,12 @@ public class Keyboard2View extends View
width = metrics.getBounds().width();
WindowInsets wi = metrics.getWindowInsets();
int insets_types =
WindowInsets.Type.statusBars()
WindowInsets.Type.systemBars()
| WindowInsets.Type.displayCutout()
| WindowInsets.Type.mandatorySystemGestures()
| WindowInsets.Type.navigationBars();
| WindowInsets.Type.mandatorySystemGestures();
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);
}
else