diff options
| author | 2022-10-15 08:25:14 +0000 | |
|---|---|---|
| committer | 2022-10-15 08:25:14 +0000 | |
| commit | c2b8dedbe58d09ad8f8c197083907568a73fa98f (patch) | |
| tree | 61256fa0a3bdc268acfdeab60fe693f8bcfead3c | |
| parent | 093d543c6f6e0880362d3c6fe2a91fe8adde6747 (diff) | |
| parent | 8c091c7d6b1d64d686317c6e8b36345bcadfa84f (diff) | |
Merge "[Bouncer] Add better way to determine inflection." into tm-qpr-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewTransition.kt | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewTransition.kt b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewTransition.kt index 9eb2c118abac..c9128e5881cc 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewTransition.kt +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityViewTransition.kt @@ -109,12 +109,13 @@ class KeyguardSecurityViewTransition : Transition() { object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { runningSecurityShiftAnimator = null + if (shouldRestoreLayerType) { + v.setLayerType(View.LAYER_TYPE_NONE, /* paint= */ null) + } } } ) - var finishedFadingOutNonSecurityView = false - runningSecurityShiftAnimator.addUpdateListener { animation: ValueAnimator -> val switchPoint = SECURITY_SHIFT_ANIMATION_FADE_OUT_PROPORTION val isFadingOut = animation.animatedFraction < switchPoint @@ -153,6 +154,13 @@ class KeyguardSecurityViewTransition : Transition() { startRect.right + currentTranslation, startRect.bottom ) + } else { + v.setLeftTopRightBottom( + startRect.left, + startRect.top, + startRect.right, + startRect.bottom + ) } } else { // And in again over the remaining (100-X)%. @@ -175,32 +183,13 @@ class KeyguardSecurityViewTransition : Transition() { endRect.right - translationRemaining, endRect.bottom ) - } - } - if (animation.animatedFraction == 1.0f && shouldRestoreLayerType) { - v.setLayerType(View.LAYER_TYPE_NONE, /* paint= */ null) - } - - // For views that are not the security view flipper, we do not want to apply - // an x translation animation. Instead, we want to fade out, move to final position and - // then fade in. - if (v !is KeyguardSecurityViewFlipper) { - // Opacity goes close to 0 but does not fully get to 0. - if (opacity - 0.001f < 0f) { + } else { v.setLeftTopRightBottom( endRect.left, endRect.top, endRect.right, endRect.bottom ) - finishedFadingOutNonSecurityView = true - } else if (!finishedFadingOutNonSecurityView) { - v.setLeftTopRightBottom( - startRect.left, - startRect.top, - startRect.right, - startRect.bottom - ) } } } |