diff --git a/java/MainActivity.java b/java/MainActivity.java index 6fa2c096..44da152d 100644 --- a/java/MainActivity.java +++ b/java/MainActivity.java @@ -210,13 +210,18 @@ public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) { Insets imeInsets = insets.getInsets(WindowInsets.Type.ime()); Insets sysInsets = insets.getInsets(WindowInsets.Type.systemBars()); + int bottomPadding = sysInsets.bottom; + if (imeInsets.bottom > 0) { + bottomPadding = imeInsets.bottom; + } + // The sys insets change when orientation changes and sys bars // change position. v.setPadding( sysInsets.left, sysInsets.top, sysInsets.right, - imeInsets.bottom + sysInsets.bottom + bottomPadding ); } return insets;