diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index 9f9cb00c07..d3ef58936e 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -16,6 +16,7 @@ package com.android.launcher3.uioverrides.touchcontrollers; import static android.view.MotionEvent.ACTION_DOWN; +import static android.view.MotionEvent.ACTION_MOVE; import static com.android.app.animation.Interpolators.ACCELERATE_0_75; import static com.android.app.animation.Interpolators.DECELERATE_3; @@ -261,7 +262,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController, xAnim.setFloat(mRecentsView, ADJACENT_PAGE_HORIZONTAL_OFFSET, scaleAndOffset[1], LINEAR); // Use QuickSwitchState instead of OverviewState to determine scrim color, // since we need to take potential taskbar into account. - xAnim.setScrimViewBackgroundColor(mLauncher.getScrimView(), + xAnim.setViewBackgroundColor(mLauncher.getScrimView(), QUICK_SWITCH_FROM_HOME.getWorkspaceScrimColor(mLauncher), LINEAR); if (mRecentsView.getTaskViewCount() == 0) { xAnim.addFloat(mRecentsView, CONTENT_ALPHA, 0f, 1f, LINEAR); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java index ca8381b4bf..8a9e04e488 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsStateController.java @@ -114,7 +114,7 @@ public class FallbackRecentsStateController implements StateHandler threshold; + && getAlpha() > threshold + && (Color.alpha(mBackgroundColor) / 255f) > threshold; if (forceChange) { getSystemUiController().updateUiState(UI_STATE_SCRIM_VIEW, !isScrimDark()); } else { @@ -144,7 +148,13 @@ public class ScrimView extends View implements Insettable { } private boolean isScrimDark() { - return ColorUtils.calculateLuminance(mBackgroundColor) < 0.5f; + if (!(getBackground() instanceof ColorDrawable)) { + throw new IllegalStateException( + "ScrimView must have a ColorDrawable background, this one has: " + + getBackground()); + } + return ColorUtils.calculateLuminance( + ((ColorDrawable) getBackground()).getColor()) < 0.5f; } /**