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/Utils.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'srcs/juloo.keyboard2/Utils.java') diff --git a/srcs/juloo.keyboard2/Utils.java b/srcs/juloo.keyboard2/Utils.java index f0f3036..88c865c 100644 --- a/srcs/juloo.keyboard2/Utils.java +++ b/srcs/juloo.keyboard2/Utils.java @@ -1,8 +1,13 @@ package juloo.keyboard2; import android.app.AlertDialog; +import android.content.res.Resources; +import android.graphics.Insets; +import android.os.Build.VERSION; import android.os.IBinder; +import android.view.View; import android.view.Window; +import android.view.WindowInsets; import android.view.WindowManager; import java.io.InputStream; import java.io.InputStreamReader; @@ -44,4 +49,14 @@ public final class Utils out.append(buff, 0, l); return out.toString(); } + + /** Whether the thin gesture-navigation bar is used. + https://stackoverflow.com/questions/36514167/how-to-really-get-the-navigation-bar-height-in-android + */ + public static boolean is_navigation_bar_gestural(Resources res) + { + // core/java/android/view/WindowManagerPolicyConstants.java + int res_id = res.getIdentifier("config_navBarInteractionMode", "integer", "android"); + return (res_id > 0 && res.getInteger(res_id) == 2); + } } -- cgit v1.2.3