Skip to content

Commit d1cd5d4

Browse files
dsn5ftymarian
authored andcommitted
Only use window insets for Snackbar (BaseTransientBottomBar) bottom margin if
anchor view is not provided PiperOrigin-RevId: 230532747
1 parent ce2af89 commit d1cd5d4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/java/com/google/android/material/snackbar/BaseTransientBottomBar.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,12 @@ private Drawable createThemedBackground() {
366366

367367
private void updateBottomMargin() {
368368
MarginLayoutParams layoutParams = (MarginLayoutParams) view.getLayoutParams();
369-
layoutParams.bottomMargin =
370-
originalBottomMargin + extraBottomMarginInsets + extraBottomMarginAnchorView;
369+
layoutParams.bottomMargin = originalBottomMargin;
370+
if (anchorView != null) {
371+
layoutParams.bottomMargin += extraBottomMarginAnchorView;
372+
} else {
373+
layoutParams.bottomMargin += extraBottomMarginInsets;
374+
}
371375
view.setLayoutParams(layoutParams);
372376
}
373377

0 commit comments

Comments
 (0)