diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index 8d32c9ca2935..5e25443d984d 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -91,6 +91,7 @@ public class RecentsView extends FrameLayout { private static final int DEFAULT_UPDATE_SCRIM_DURATION = 200; private static final float DEFAULT_SCRIM_ALPHA = 0.33f; + private static final float GRID_LAYOUT_SCRIM_ALPHA = 0.45f; private static final int SHOW_STACK_ACTION_BUTTON_DURATION = 134; private static final int HIDE_STACK_ACTION_BUTTON_DURATION = 100; @@ -106,8 +107,8 @@ public class RecentsView extends FrameLayout { Rect mSystemInsets = new Rect(); private int mDividerSize; - private Drawable mBackgroundScrim = new ColorDrawable( - Color.argb((int) (DEFAULT_SCRIM_ALPHA * 255), 0, 0, 0)).mutate(); + private final float mScrimAlpha; + private final Drawable mBackgroundScrim; private Animator mBackgroundScrimAnimator; private RecentsTransitionHelper mTransitionHelper; @@ -136,6 +137,10 @@ public class RecentsView extends FrameLayout { mDividerSize = ssp.getDockedDividerSize(context); mTouchHandler = new RecentsViewTouchHandler(this); mFlingAnimationUtils = new FlingAnimationUtils(context, 0.3f); + mScrimAlpha = Recents.getConfiguration().isGridEnabled + ? GRID_LAYOUT_SCRIM_ALPHA : DEFAULT_SCRIM_ALPHA; + mBackgroundScrim = new ColorDrawable( + Color.argb((int) (mScrimAlpha * 255), 0, 0, 0)).mutate(); LayoutInflater inflater = LayoutInflater.from(context); if (RecentsDebugFlags.Static.EnableStackActionButton) { @@ -758,7 +763,7 @@ public class RecentsView extends FrameLayout { private void animateBackgroundScrim(float alpha, int duration) { Utilities.cancelAnimationWithoutCallbacks(mBackgroundScrimAnimator); // Calculate the absolute alpha to animate from - int fromAlpha = (int) ((mBackgroundScrim.getAlpha() / (DEFAULT_SCRIM_ALPHA * 255)) * 255); + int fromAlpha = (int) ((mBackgroundScrim.getAlpha() / (mScrimAlpha * 255)) * 255); int toAlpha = (int) (alpha * 255); mBackgroundScrimAnimator = ObjectAnimator.ofInt(mBackgroundScrim, Utilities.DRAWABLE_ALPHA, fromAlpha, toAlpha); |