Only use window insets for Snackbar (BaseTransientBottomBar) bottom margin if

anchor view is not provided

PiperOrigin-RevId: 230532747
This commit is contained in:
dniz 2019-01-23 11:17:24 -05:00 committed by ymarian
parent ce2af89a1d
commit d1cd5d451f

View File

@ -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);
}