Commit 56d45f06 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Android][TouchToFill] Prevent double-dismissing the bottom sheet

If the touch to fill sheet is dismissed, it triggers a second call to
BottomSheetController#hideContent.

That call triggers an observer in the BottomContainer again which then
moves itself out of the visible view port.
(The latter can only happen since a division by zero bypasses some guard
conditions. It might make sense to abort attempts at repeatedly
dismissing the bottomsheet but this exceeds the scope of this CL.)

Bug: 1021550
Change-Id: Ida2b6bc9ffd18513419bed40b29ca84528310907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899882Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712703}
parent a311f5a3
......@@ -82,7 +82,7 @@ class TouchToFillView implements BottomSheetContent {
if (isVisible) {
mBottomSheetController.addObserver(mBottomSheetObserver);
mBottomSheetController.requestShowContent(this, true);
} else {
} else if (mBottomSheetController.isSheetOpen()) {
mBottomSheetController.hideContent(this, true);
}
}
......
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