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

Android: Constant alpha on gesture navigation sheet scrim

This CL removes |onSheetStateChanged| that updates scrim alpha
to the height of the sheet view. Scrim alpha in opened state
stays constant.

Bug: 993032
Change-Id: Idabf5735e282bbd28e4e290a67ce033c5a9c8f08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760834
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691962}
parent 9a1bc18f
......@@ -137,7 +137,7 @@ public class ScrimView extends View implements View.OnClickListener {
}
/** The duration for the fading animation. */
private static final int FADE_DURATION_MS = 250;
private static final int FADE_DURATION_MS = 300;
/** A means of changing the statusbar color. */
private final StatusBarScrimDelegate mStatusBarScrimDelegate;
......
......@@ -5,7 +5,6 @@
package org.chromium.chrome.browser.widget.bottomsheet;
import android.app.Activity;
import android.view.View;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ActivityTabProvider;
......@@ -192,7 +191,7 @@ public class BottomSheetController implements Destroyable {
return;
}
scrim.hideScrim(false);
scrim.hideScrim(true);
// If the sheet is closed, it is an opportunity for another content to try to take
// its place if it is a higher priority.
......@@ -212,19 +211,6 @@ public class BottomSheetController implements Destroyable {
showNextContent(true);
}
@Override
public void onTransitionPeekToHalf(float transitionFraction) {
if (mBottomSheet.getCurrentSheetContent() != null
&& mBottomSheet.getCurrentSheetContent().hasCustomScrimLifecycle()) {
return;
}
// TODO(mdjones): This event should not occur after the bottom sheet is closed.
if (scrim.getVisibility() == View.VISIBLE) {
scrim.setViewAlpha(transitionFraction);
}
}
@Override
public void onSheetOffsetChanged(float heightFraction, float offsetPx) {
mSnackbarManager.dismissAllSnackbars();
......
......@@ -117,6 +117,7 @@ public class ScrimTest {
@SmallTest
@Feature({"Scrim"})
public void testBottomSheetScrim() throws InterruptedException, TimeoutException {
mScrim.disableAnimationForTesting(true);
assertScrimVisibility(false);
assertFalse("Nothing should be obscuring the tab.",
mActivityTestRule.getActivity().isViewObscuringAllTabs());
......@@ -131,7 +132,7 @@ public class ScrimTest {
assertScrimVisibility(true);
assertTrue("A view should be obscuring the tab.",
mActivityTestRule.getActivity().isViewObscuringAllTabs());
assertEquals("The scrim alpha should be 1.", 1f, mScrim.getAlpha(), MathUtils.EPSILON);
assertEquals("The scrim alpha should be 0.", 0f, mScrim.getAlpha(), MathUtils.EPSILON);
ThreadUtils.runOnUiThreadBlocking(
() -> mBottomSheet.setSheetState(BottomSheet.SheetState.PEEK, 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