2D Recents: use a slightly darker scrim background
Bug: 32101881 Test: Checked recents layout on local sw600dp device Change-Id: Ic5ae1c1c805896a4cd8d6c3473fa2c693e94d304
This commit is contained in:
@@ -91,6 +91,7 @@ public class RecentsView extends FrameLayout {
|
|||||||
|
|
||||||
private static final int DEFAULT_UPDATE_SCRIM_DURATION = 200;
|
private static final int DEFAULT_UPDATE_SCRIM_DURATION = 200;
|
||||||
private static final float DEFAULT_SCRIM_ALPHA = 0.33f;
|
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 SHOW_STACK_ACTION_BUTTON_DURATION = 134;
|
||||||
private static final int HIDE_STACK_ACTION_BUTTON_DURATION = 100;
|
private static final int HIDE_STACK_ACTION_BUTTON_DURATION = 100;
|
||||||
@@ -106,8 +107,8 @@ public class RecentsView extends FrameLayout {
|
|||||||
Rect mSystemInsets = new Rect();
|
Rect mSystemInsets = new Rect();
|
||||||
private int mDividerSize;
|
private int mDividerSize;
|
||||||
|
|
||||||
private Drawable mBackgroundScrim = new ColorDrawable(
|
private final float mScrimAlpha;
|
||||||
Color.argb((int) (DEFAULT_SCRIM_ALPHA * 255), 0, 0, 0)).mutate();
|
private final Drawable mBackgroundScrim;
|
||||||
private Animator mBackgroundScrimAnimator;
|
private Animator mBackgroundScrimAnimator;
|
||||||
|
|
||||||
private RecentsTransitionHelper mTransitionHelper;
|
private RecentsTransitionHelper mTransitionHelper;
|
||||||
@@ -136,6 +137,10 @@ public class RecentsView extends FrameLayout {
|
|||||||
mDividerSize = ssp.getDockedDividerSize(context);
|
mDividerSize = ssp.getDockedDividerSize(context);
|
||||||
mTouchHandler = new RecentsViewTouchHandler(this);
|
mTouchHandler = new RecentsViewTouchHandler(this);
|
||||||
mFlingAnimationUtils = new FlingAnimationUtils(context, 0.3f);
|
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);
|
LayoutInflater inflater = LayoutInflater.from(context);
|
||||||
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
if (RecentsDebugFlags.Static.EnableStackActionButton) {
|
||||||
@@ -758,7 +763,7 @@ public class RecentsView extends FrameLayout {
|
|||||||
private void animateBackgroundScrim(float alpha, int duration) {
|
private void animateBackgroundScrim(float alpha, int duration) {
|
||||||
Utilities.cancelAnimationWithoutCallbacks(mBackgroundScrimAnimator);
|
Utilities.cancelAnimationWithoutCallbacks(mBackgroundScrimAnimator);
|
||||||
// Calculate the absolute alpha to animate from
|
// 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);
|
int toAlpha = (int) (alpha * 255);
|
||||||
mBackgroundScrimAnimator = ObjectAnimator.ofInt(mBackgroundScrim, Utilities.DRAWABLE_ALPHA,
|
mBackgroundScrimAnimator = ObjectAnimator.ofInt(mBackgroundScrim, Utilities.DRAWABLE_ALPHA,
|
||||||
fromAlpha, toAlpha);
|
fromAlpha, toAlpha);
|
||||||
|
|||||||
Reference in New Issue
Block a user