Commit 3d660fd2 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

PreviewTab: Make sure the hidden preview tab visible on show request

It is possible that the preview tab is requested to open, while it
is already the current bottom sheet content just hidden in the
controller. This CL makes sure it will be visible by moving it to
the appropriate peek/open state.

Bug: 1057966
Change-Id: Id3dca309738d22cca5086325272a4aa0dff67724
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087307Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748479}
parent 264d876a
...@@ -556,7 +556,12 @@ public class BottomSheetController implements Destroyable { ...@@ -556,7 +556,12 @@ public class BottomSheetController implements Destroyable {
if (mBottomSheet == null) mSheetInitializer.run(); if (mBottomSheet == null) mSheetInitializer.run();
// If already showing the requested content, do nothing. // If already showing the requested content, do nothing.
if (content == mBottomSheet.getCurrentSheetContent()) return true; if (content == mBottomSheet.getCurrentSheetContent()) {
if (getSheetState() == SheetState.HIDDEN) {
mBottomSheet.setSheetState(mBottomSheet.getOpeningState(), animate);
}
return true;
}
// Showing the sheet requires a tab. // Showing the sheet requires a tab.
if (mTabProvider.get() == null) return false; if (mTabProvider.get() == null) return false;
......
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