From 6187d99828d2f45ce918387086eb1b954d7f20f3 Mon Sep 17 00:00:00 2001 From: Beverly Date: Tue, 25 Apr 2023 19:57:35 +0000 Subject: [PATCH] Quickly fade out the UDFPS icon on launch animations As per the UX spec, the UDFPS icon will fade out in the first 83ms of the launch transition animation. Fixes: 276712829 Test: manually launch QR reader quick affordance on the lock screen when UDFPS is enrolled, see the UDFPS icon fades out BEFORE the activity is launched Change-Id: I8293fd3b2e03859636496f3053ff3b33357bbdfe --- .../systemui/biometrics/UdfpsKeyguardViewController.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt index 3b50bbcd92518..935de0255c01a 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt @@ -464,7 +464,12 @@ constructor( // Fade out the icon if we are animating an activity launch over the lockscreen and the // activity didn't request the UDFPS. if (isLaunchingActivity && !udfpsRequested) { - alpha = (alpha * (1.0f - activityLaunchProgress)).toInt() + val udfpsActivityLaunchAlphaMultiplier = + 1f - + (activityLaunchProgress * + (ActivityLaunchAnimator.TIMINGS.totalDuration / 83)) + .coerceIn(0f, 1f) + alpha = (alpha * udfpsActivityLaunchAlphaMultiplier).toInt() } // Fade out alpha when a dialog is shown