Skip to content

Commit

Permalink
when the IME is shown, it covers the systemBars at the bottom. So we …
Browse files Browse the repository at this point in the history
…just use the IME height for the bottom padding.
  • Loading branch information
jkds authored and not-fl3 committed Nov 30, 2024
1 parent ceddf76 commit da4efb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion java/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit da4efb1

Please sign in to comment.