Merge "Darker scrim when pulsing"

This commit is contained in:
TreeHugger Robot
2019-03-12 03:34:36 +00:00
committed by Android (Google) Code Review
3 changed files with 7 additions and 4 deletions

View File

@@ -89,6 +89,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
* Default alpha value for most scrims.
*/
public static final float GRADIENT_SCRIM_ALPHA = 0.2f;
/**
* Scrim opacity when the phone is about to wake-up.
*/
public static final float AOD2_SCRIM_ALPHA = 0.6f;
/**
* A scrim varies its opacity based on a busyness factor, for example
* how many notifications are currently visible.

View File

@@ -133,11 +133,10 @@ public enum ScrimState {
|| mPulseReason == DozeLog.PULSE_REASON_DOCKING
|| mPulseReason == DozeLog.PULSE_REASON_INTENT) {
mCurrentBehindAlpha = previousState.getBehindAlpha();
mCurrentBehindTint = Color.BLACK;
} else {
mCurrentBehindAlpha = mScrimBehindAlphaKeyguard;
mCurrentBehindTint = Color.TRANSPARENT;
mCurrentBehindAlpha = ScrimController.AOD2_SCRIM_ALPHA;
}
mCurrentBehindTint = Color.BLACK;
mBlankScreen = mDisplayRequiresBlanking;
}
},

View File

@@ -232,7 +232,7 @@ public class ScrimControllerTest extends SysuiTestCase {
// Back scrim should be semi-transparent so the user can see the wallpaper
// Pulse callback should have been invoked
assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_SEMI_TRANSPARENT);
assertScrimTint(mScrimBehind, false /* tinted */);
assertScrimTint(mScrimBehind, true /* tinted */);
}
@Test