abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Utils.java
diff options
context:
space:
mode:
authorJules Aguillon2024-12-26 18:29:19 +0100
committerGitHub2024-12-26 18:29:19 +0100
commit370f921bc367613164d93dc1ddbd28c57042e0a7 (patch)
tree2e437ccf8966fbd59a8b0b9c70f6f47dcc8a497e /srcs/juloo.keyboard2/Utils.java
parent57dbf3292fa7900f99fe503195d6cf20022eb653 (diff)
downloadunexpected-keyboard-370f921bc367613164d93dc1ddbd28c57042e0a7.tar.gz
unexpected-keyboard-370f921bc367613164d93dc1ddbd28c57042e0a7.zip
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.
Diffstat (limited to 'srcs/juloo.keyboard2/Utils.java')
-rw-r--r--srcs/juloo.keyboard2/Utils.java15
1 files changed, 15 insertions, 0 deletions
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);
+ }
}