Skip to content

Commit 1304522

Browse files
pekingmeraajkumars
authored andcommitted
[BottomSheet] Fixed IME bottom padding is ignored in edge-to-edge case. Reverted to use deprecated getSystemWindowInsetBottom() for bottom inset to align with behaviors in 1.5.0.
Resolves: #2543 PiperOrigin-RevId: 428856163
1 parent b01051b commit 1304522

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,7 @@ private void setWindowInsetsListener(@NonNull View child) {
14661466
child,
14671467
new ViewUtils.OnApplyWindowInsetsListener() {
14681468
@Override
1469+
@SuppressWarnings("deprecation") // getSystemWindowInsetBottom is used for adjustResize.
14691470
public WindowInsetsCompat onApplyWindowInsets(
14701471
View view, WindowInsetsCompat insets, RelativePadding initialPadding) {
14711472
Insets systemBarInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars());
@@ -1481,7 +1482,9 @@ public WindowInsetsCompat onApplyWindowInsets(
14811482
int rightPadding = view.getPaddingRight();
14821483

14831484
if (paddingBottomSystemWindowInsets) {
1484-
insetBottom = systemBarInsets.bottom;
1485+
// Intentionally uses getSystemWindowInsetBottom to apply padding properly when
1486+
// adjustResize is used as the windowSoftInputMode.
1487+
insetBottom = insets.getSystemWindowInsetBottom();
14851488
bottomPadding = initialPadding.bottom + insetBottom;
14861489
}
14871490

0 commit comments

Comments
 (0)