Commit c815be43 authored by sandromaggi's avatar sandromaggi Committed by Commit Bot

BottomSheet keep padding

Before this change, the BottomSheet reset all paddings (except bottom)
to 0 when showing/hiding the keyboard. This irreversibly reset some
padding defined in XML.
Keep the existing padding for left, top, right and only set bottom to
a variable value.

Bug: b/152947599
Change-Id: I31cfec4bf8c8509ef39b1d0dbca0c5c7913b8db3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2141927Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Cr-Commit-Position: refs/heads/master@{#757942}
parent 383cd0a2
...@@ -313,7 +313,10 @@ class BottomSheet extends FrameLayout ...@@ -313,7 +313,10 @@ class BottomSheet extends FrameLayout
// This shrinks the content size while retaining the default background color // This shrinks the content size while retaining the default background color
// where the keyboard is appearing. If the sheet is not showing, resize the // where the keyboard is appearing. If the sheet is not showing, resize the
// sheet to its default state. // sheet to its default state.
mBottomSheetContentContainer.setPadding(0, 0, 0, keyboardHeight); mBottomSheetContentContainer.setPadding(
mBottomSheetContentContainer.getPaddingLeft(),
mBottomSheetContentContainer.getPaddingTop(),
mBottomSheetContentContainer.getPaddingRight(), keyboardHeight);
} }
if (previousHeight != mContainerHeight if (previousHeight != mContainerHeight
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment