Merge "Update alternate bouncer scrim values" into tm-qpr-dev
This commit is contained in:
@@ -820,15 +820,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
|
|||||||
mNotificationsAlpha = KEYGUARD_SCRIM_ALPHA;
|
mNotificationsAlpha = KEYGUARD_SCRIM_ALPHA;
|
||||||
}
|
}
|
||||||
} else if (mState == ScrimState.AUTH_SCRIMMED_SHADE) {
|
} else if (mState == ScrimState.AUTH_SCRIMMED_SHADE) {
|
||||||
float behindFraction = getInterpolatedFraction();
|
mNotificationsAlpha = (float) Math.pow(getInterpolatedFraction(), 0.8f);
|
||||||
behindFraction = (float) Math.pow(behindFraction, 0.8f);
|
|
||||||
|
|
||||||
mBehindAlpha = behindFraction * mDefaultScrimAlpha;
|
|
||||||
mNotificationsAlpha = mBehindAlpha;
|
|
||||||
if (mClipsQsScrim) {
|
|
||||||
mBehindAlpha = 1;
|
|
||||||
mBehindTint = Color.BLACK;
|
|
||||||
}
|
|
||||||
} else if (mState == ScrimState.KEYGUARD || mState == ScrimState.SHADE_LOCKED
|
} else if (mState == ScrimState.KEYGUARD || mState == ScrimState.SHADE_LOCKED
|
||||||
|| mState == ScrimState.PULSING) {
|
|| mState == ScrimState.PULSING) {
|
||||||
Pair<Integer, Float> result = calculateBackStateForState(mState);
|
Pair<Integer, Float> result = calculateBackStateForState(mState);
|
||||||
|
|||||||
@@ -90,11 +90,14 @@ public enum ScrimState {
|
|||||||
AUTH_SCRIMMED_SHADE {
|
AUTH_SCRIMMED_SHADE {
|
||||||
@Override
|
@Override
|
||||||
public void prepare(ScrimState previousState) {
|
public void prepare(ScrimState previousState) {
|
||||||
// notif & behind scrim alpha values are determined by ScrimController#applyState
|
// notif scrim alpha values are determined by ScrimController#applyState
|
||||||
// based on the shade expansion
|
// based on the shade expansion
|
||||||
|
|
||||||
mFrontTint = Color.BLACK;
|
mFrontTint = Color.BLACK;
|
||||||
mFrontAlpha = .66f;
|
mFrontAlpha = .66f;
|
||||||
|
|
||||||
|
mBehindTint = Color.BLACK;
|
||||||
|
mBehindAlpha = 1f;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1150,7 +1150,7 @@ public class ScrimControllerTest extends SysuiTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAuthScrim_notifScrimOpaque_whenShadeFullyExpanded() {
|
public void testAuthScrim_setClipQSScrimTrue_notifScrimOpaque_whenShadeFullyExpanded() {
|
||||||
// GIVEN device has an activity showing ('UNLOCKED' state can occur on the lock screen
|
// GIVEN device has an activity showing ('UNLOCKED' state can occur on the lock screen
|
||||||
// with the camera app occluding the keyguard)
|
// with the camera app occluding the keyguard)
|
||||||
mScrimController.transitionTo(ScrimState.UNLOCKED);
|
mScrimController.transitionTo(ScrimState.UNLOCKED);
|
||||||
@@ -1176,6 +1176,34 @@ public class ScrimControllerTest extends SysuiTestCase {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAuthScrim_setClipQSScrimFalse_notifScrimOpaque_whenShadeFullyExpanded() {
|
||||||
|
// GIVEN device has an activity showing ('UNLOCKED' state can occur on the lock screen
|
||||||
|
// with the camera app occluding the keyguard)
|
||||||
|
mScrimController.transitionTo(ScrimState.UNLOCKED);
|
||||||
|
mScrimController.setClipsQsScrim(false);
|
||||||
|
mScrimController.setRawPanelExpansionFraction(1);
|
||||||
|
// notifications scrim alpha change require calling setQsPosition
|
||||||
|
mScrimController.setQsPosition(0, 300);
|
||||||
|
finishAnimationsImmediately();
|
||||||
|
|
||||||
|
// WHEN the user triggers the auth bouncer
|
||||||
|
mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED_SHADE);
|
||||||
|
finishAnimationsImmediately();
|
||||||
|
|
||||||
|
assertEquals("Behind scrim should be opaque",
|
||||||
|
mScrimBehind.getViewAlpha(), 1, 0.0);
|
||||||
|
assertEquals("Notifications scrim should be opaque",
|
||||||
|
mNotificationsScrim.getViewAlpha(), 1, 0.0);
|
||||||
|
|
||||||
|
assertScrimTinted(Map.of(
|
||||||
|
mScrimInFront, true,
|
||||||
|
mScrimBehind, true,
|
||||||
|
mNotificationsScrim, false
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAuthScrimKeyguard() {
|
public void testAuthScrimKeyguard() {
|
||||||
// GIVEN device is on the keyguard
|
// GIVEN device is on the keyguard
|
||||||
|
|||||||
Reference in New Issue
Block a user