Commit 0ec30b7a authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[TouchToFill][Android] Wait until peeking finished before expanding

Currently, the sheet is asked to skip the peeking. Since this doesn't
seem to work as intended (see https://crbug.com/1012231), we expand
this sheet. Expanding immediately might have no effect — most likely
a timing issue (see first screenshot in linked bug).

Therefore, this CL allows the peek state and expands the sheet as soon
as the peek state is shown.

Bug: 1011856
Change-Id: I63cc403a9acc93f2e4f90c2549c32cf39757f042
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847294Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703714}
parent 66f711cb
......@@ -39,6 +39,13 @@ class TouchToFillView implements BottomSheet.BottomSheetContent {
mEventListener.onDismissed();
mBottomSheetController.getBottomSheet().removeObserver(mBottomSheetObserver);
}
@Override
public void onSheetFullyPeeked() {
super.onSheetFullyPeeked();
// Since isPeekStateEnabled doesn't seem to skip the Peek state, force-expand the sheet.
mBottomSheetController.expandSheet();
}
};
/**
......@@ -71,9 +78,6 @@ class TouchToFillView implements BottomSheet.BottomSheetContent {
if (isVisible) {
mBottomSheetController.getBottomSheet().addObserver(mBottomSheetObserver);
mBottomSheetController.requestShowContent(this, false);
// Even though isPeekStateEnabled always returns false, the sheet will peek by default.
// Calling expand forces it into Half-open state.
mBottomSheetController.expandSheet();
} else {
mBottomSheetController.hideContent(this, false);
}
......@@ -137,7 +141,7 @@ class TouchToFillView implements BottomSheet.BottomSheetContent {
@Override
public boolean isPeekStateEnabled() {
return false;
return true; // For some reason, false isn't working properly. Extend it explicitly!
}
@Override
......
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