mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Only use window insets for Snackbar (BaseTransientBottomBar) bottom margin if
anchor view is not provided PiperOrigin-RevId: 230532747
This commit is contained in:
parent
ce2af89a1d
commit
d1cd5d451f
@ -366,8 +366,12 @@ public abstract class BaseTransientBottomBar<B extends BaseTransientBottomBar<B>
|
||||
|
||||
private void updateBottomMargin() {
|
||||
MarginLayoutParams layoutParams = (MarginLayoutParams) view.getLayoutParams();
|
||||
layoutParams.bottomMargin =
|
||||
originalBottomMargin + extraBottomMarginInsets + extraBottomMarginAnchorView;
|
||||
layoutParams.bottomMargin = originalBottomMargin;
|
||||
if (anchorView != null) {
|
||||
layoutParams.bottomMargin += extraBottomMarginAnchorView;
|
||||
} else {
|
||||
layoutParams.bottomMargin += extraBottomMarginInsets;
|
||||
}
|
||||
view.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user