Merge "[Bouncer] Add better way to determine inflection." into tm-qpr-dev am: c2b8dedbe5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20191918 Change-Id: Ia8119cdbf056cb2bf3c2e2205ab078aa3050c10d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -109,12 +109,13 @@ class KeyguardSecurityViewTransition : Transition() {
|
|||||||
object : AnimatorListenerAdapter() {
|
object : AnimatorListenerAdapter() {
|
||||||
override fun onAnimationEnd(animation: Animator) {
|
override fun onAnimationEnd(animation: Animator) {
|
||||||
runningSecurityShiftAnimator = null
|
runningSecurityShiftAnimator = null
|
||||||
|
if (shouldRestoreLayerType) {
|
||||||
|
v.setLayerType(View.LAYER_TYPE_NONE, /* paint= */ null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var finishedFadingOutNonSecurityView = false
|
|
||||||
|
|
||||||
runningSecurityShiftAnimator.addUpdateListener { animation: ValueAnimator ->
|
runningSecurityShiftAnimator.addUpdateListener { animation: ValueAnimator ->
|
||||||
val switchPoint = SECURITY_SHIFT_ANIMATION_FADE_OUT_PROPORTION
|
val switchPoint = SECURITY_SHIFT_ANIMATION_FADE_OUT_PROPORTION
|
||||||
val isFadingOut = animation.animatedFraction < switchPoint
|
val isFadingOut = animation.animatedFraction < switchPoint
|
||||||
@@ -153,6 +154,13 @@ class KeyguardSecurityViewTransition : Transition() {
|
|||||||
startRect.right + currentTranslation,
|
startRect.right + currentTranslation,
|
||||||
startRect.bottom
|
startRect.bottom
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
v.setLeftTopRightBottom(
|
||||||
|
startRect.left,
|
||||||
|
startRect.top,
|
||||||
|
startRect.right,
|
||||||
|
startRect.bottom
|
||||||
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// And in again over the remaining (100-X)%.
|
// And in again over the remaining (100-X)%.
|
||||||
@@ -175,32 +183,13 @@ class KeyguardSecurityViewTransition : Transition() {
|
|||||||
endRect.right - translationRemaining,
|
endRect.right - translationRemaining,
|
||||||
endRect.bottom
|
endRect.bottom
|
||||||
)
|
)
|
||||||
}
|
} else {
|
||||||
}
|
|
||||||
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) {
|
|
||||||
v.setLeftTopRightBottom(
|
v.setLeftTopRightBottom(
|
||||||
endRect.left,
|
endRect.left,
|
||||||
endRect.top,
|
endRect.top,
|
||||||
endRect.right,
|
endRect.right,
|
||||||
endRect.bottom
|
endRect.bottom
|
||||||
)
|
)
|
||||||
finishedFadingOutNonSecurityView = true
|
|
||||||
} else if (!finishedFadingOutNonSecurityView) {
|
|
||||||
v.setLeftTopRightBottom(
|
|
||||||
startRect.left,
|
|
||||||
startRect.top,
|
|
||||||
startRect.right,
|
|
||||||
startRect.bottom
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user