diff --git a/android/capacitor/src/main/java/com/getcapacitor/plugin/SystemBars.java b/android/capacitor/src/main/java/com/getcapacitor/plugin/SystemBars.java index fd7137094..5b6246b53 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/plugin/SystemBars.java +++ b/android/capacitor/src/main/java/com/getcapacitor/plugin/SystemBars.java @@ -204,8 +204,12 @@ private void initWindowInsetsListener() { boolean keyboardVisible = insets.isVisible(WindowInsetsCompat.Type.ime()); if (shouldPassthroughInsets) { - // We need to correct for a possible shown IME - v.setPadding(0, 0, 0, keyboardVisible ? imeInsets.bottom : 0); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) { + // We need to correct for a possible shown IME + // On API <= 34 the window is not edge-to-edge, so the system already + // resizes it for the IME and extra padding would double the space + v.setPadding(0, 0, 0, keyboardVisible ? imeInsets.bottom : 0); + } Insets safeAreaInsets = calcSafeAreaInsets(insets); injectSafeAreaCSS(safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left);