diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index d3ef58936e..9f9cb00c07 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -16,7 +16,6 @@ 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; @@ -262,7 +261,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.setViewBackgroundColor(mLauncher.getScrimView(), + xAnim.setScrimViewBackgroundColor(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 8a9e04e488..ca8381b4bf 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 - && (Color.alpha(mBackgroundColor) / 255f) > threshold; + && getAlpha() > threshold; if (forceChange) { getSystemUiController().updateUiState(UI_STATE_SCRIM_VIEW, !isScrimDark()); } else { @@ -148,13 +144,7 @@ public class ScrimView extends View implements Insettable { } private boolean isScrimDark() { - 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; + return ColorUtils.calculateLuminance(mBackgroundColor) < 0.5f; } /**