From 370f921bc367613164d93dc1ddbd28c57042e0a7 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Thu, 26 Dec 2024 18:29:19 +0100 Subject: Proper support for Android 15 edge-to-edge (#848) The keyboard background now extends under the system bars and display cutout on Android 15 but the keys do not. The back and IME switching buttons that appear in the navigation bar require special care to not overlap with the keyboard. The launcher and settings activity are also fixed. --- srcs/juloo.keyboard2/Keyboard2.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'srcs/juloo.keyboard2/Keyboard2.java') diff --git a/srcs/juloo.keyboard2/Keyboard2.java b/srcs/juloo.keyboard2/Keyboard2.java index a68b954..201449d 100644 --- a/srcs/juloo.keyboard2/Keyboard2.java +++ b/srcs/juloo.keyboard2/Keyboard2.java @@ -292,6 +292,15 @@ public class Keyboard2 extends InputMethodService private void updateSoftInputWindowLayoutParams() { final Window window = getWindow().getWindow(); + // On API >= 30, Keyboard2View behaves as edge-to-edge + if (VERSION.SDK_INT >= 30) + { + WindowManager.LayoutParams wattrs = window.getAttributes(); + wattrs.layoutInDisplayCutoutMode = + WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS; + // Allow to draw behind system bars + wattrs.setFitInsetsTypes(0); + } updateLayoutHeightOf(window, ViewGroup.LayoutParams.MATCH_PARENT); final View inputArea = window.findViewById(android.R.id.inputArea); -- cgit v1.2.3