Textbox padding with Android IME fixed

This commit is contained in:
Yousef Khadadeh 2026-05-04 18:13:47 +03:00
parent d1c105cd46
commit 155d2523f1
6 changed files with 121 additions and 52 deletions

View file

@ -28,10 +28,6 @@ public class InfiniPaint extends SDLActivity {
// window.setNavigationBarContrastEnforced(false);
}
protected void get_window_insets() {
Window window = this.getWindow();
}
protected SDLSurface createSDLSurface(Context context) {
return new InfiniPaintSurface(context);
}

View file

@ -14,6 +14,8 @@ public class InfiniPaintSurface extends SDLSurface {
super(context);
}
public static native void nativeInfiniPaintUpdateIMESafeArea(int top, int bottom, int left, int right);
// Window inset calculations are different from SDL defaults
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
@ -24,6 +26,15 @@ public class InfiniPaintSurface extends SDLSurface {
WindowInsets.Type.tappableElement() |
WindowInsets.Type.displayCutout());
Insets imeInsets = insets.getInsets(WindowInsets.Type.systemBars() |
//WindowInsets.Type.systemGestures() |
//WindowInsets.Type.mandatorySystemGestures() |
WindowInsets.Type.tappableElement() |
WindowInsets.Type.displayCutout() |
WindowInsets.Type.ime());
nativeInfiniPaintUpdateIMESafeArea(imeInsets.top, imeInsets.bottom, imeInsets.left, imeInsets.right);
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom);
if (insets.isVisible(WindowInsets.Type.ime())) {