diff options
| author | 2023-03-22 14:11:38 +0000 | |
|---|---|---|
| committer | 2023-03-22 14:11:38 +0000 | |
| commit | 93e7d2ff48cec625c88e0929e4bd3a4160ecffdc (patch) | |
| tree | 8f05aa19a2719bb7c7783d02ddfa308c201f86a4 | |
| parent | 527a820d2e9ca32dd1250e68acea980e62870af5 (diff) | |
| parent | 0ad882f62daba51a5ff2298cf023e7aa03be9eac (diff) | |
Merge "Remove AuthRipple alpha animator" into tm-qpr-dev am: 0fcc591049 am: 0ad882f62d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22168615
Change-Id: I2c1f4678464c60989f890a321e3682361d831106
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt | 5 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt | 40 |
2 files changed, 7 insertions, 38 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt index 46e945ba6880..3f22f18f6fa7 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt @@ -103,11 +103,6 @@ constructor( } } - override fun onInit() { - mView.setAlphaInDuration(sysuiContext.resources.getInteger( - R.integer.auth_ripple_alpha_in_duration).toLong()) - } - @VisibleForTesting public override fun onViewAttached() { authController.addCallback(authControllerCallback) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt index 84094626193d..b0071340cf1a 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleView.kt @@ -54,12 +54,11 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at private var lockScreenColorVal = Color.WHITE private val fadeDuration = 83L private val retractDuration = 400L - private var alphaInDuration: Long = 0 private val dwellShader = DwellRippleShader() private val dwellPaint = Paint() private val rippleShader = RippleShader() private val ripplePaint = Paint() - private var unlockedRippleAnimator: AnimatorSet? = null + private var unlockedRippleAnimator: Animator? = null private var fadeDwellAnimator: Animator? = null private var retractDwellAnimator: Animator? = null private var dwellPulseOutAnimator: Animator? = null @@ -85,12 +84,12 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at } init { - rippleShader.color = 0xffffffff.toInt() // default color rippleShader.rawProgress = 0f rippleShader.pixelDensity = resources.displayMetrics.density rippleShader.sparkleStrength = RIPPLE_SPARKLE_STRENGTH updateRippleFadeParams() ripplePaint.shader = rippleShader + setLockScreenColor(0xffffffff.toInt()) // default color dwellShader.color = 0xffffffff.toInt() // default color dwellShader.progress = 0f @@ -111,10 +110,6 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at dwellRadius = sensorRadius * 1.5f } - fun setAlphaInDuration(duration: Long) { - alphaInDuration = duration - } - /** * Animate dwell ripple inwards back to radius 0 */ @@ -253,7 +248,6 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at override fun onAnimationEnd(animation: Animator?) { drawDwell = false - resetRippleAlpha() } }) start() @@ -277,22 +271,7 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at } } - val alphaInAnimator = ValueAnimator.ofInt(0, 62).apply { - duration = alphaInDuration - addUpdateListener { animator -> - rippleShader.color = ColorUtils.setAlphaComponent( - rippleShader.color, - animator.animatedValue as Int - ) - invalidate() - } - } - - unlockedRippleAnimator = AnimatorSet().apply { - playTogether( - rippleAnimator, - alphaInAnimator - ) + unlockedRippleAnimator = rippleAnimator.apply { addListener(object : AnimatorListenerAdapter() { override fun onAnimationStart(animation: Animator?) { drawRipple = true @@ -310,17 +289,12 @@ class AuthRippleView(context: Context?, attrs: AttributeSet?) : View(context, at unlockedRippleAnimator?.start() } - fun resetRippleAlpha() { - rippleShader.color = ColorUtils.setAlphaComponent( - rippleShader.color, - 255 - ) - } - fun setLockScreenColor(color: Int) { lockScreenColorVal = color - rippleShader.color = lockScreenColorVal - resetRippleAlpha() + rippleShader.color = ColorUtils.setAlphaComponent( + lockScreenColorVal, + 62 + ) } fun updateDwellRippleColor(isDozing: Boolean) { |