Merge "AuthRipple should always animate lightReveal on auth" into tm-dev
This commit is contained in:
@@ -145,6 +145,7 @@ class AuthRippleController @Inject constructor(
|
||||
val lightRevealScrim = centralSurfaces.lightRevealScrim
|
||||
if (statusBarStateController.isDozing || biometricUnlockController.isWakeAndUnlock) {
|
||||
circleReveal?.let {
|
||||
lightRevealScrim?.revealAmount = 0f
|
||||
lightRevealScrim?.revealEffect = it
|
||||
startLightRevealScrimOnKeyguardFadingAway = true
|
||||
}
|
||||
@@ -168,7 +169,8 @@ class AuthRippleController @Inject constructor(
|
||||
startDelay = keyguardStateController.keyguardFadingAwayDelay
|
||||
addUpdateListener { animator ->
|
||||
if (lightRevealScrim.revealEffect != circleReveal) {
|
||||
// if something else took over the reveal, let's do nothing.
|
||||
// if something else took over the reveal, let's cancel ourselves
|
||||
cancel()
|
||||
return@addUpdateListener
|
||||
}
|
||||
lightRevealScrim.revealAmount = animator.animatedValue as Float
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.graphics.PorterDuffColorFilter
|
||||
import android.graphics.PorterDuffXfermode
|
||||
import android.graphics.RadialGradient
|
||||
import android.graphics.Shader
|
||||
import android.os.Trace
|
||||
import android.util.AttributeSet
|
||||
import android.util.MathUtils.lerp
|
||||
import android.view.View
|
||||
@@ -222,6 +223,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context,
|
||||
|
||||
revealEffect.setRevealAmountOnScrim(value, this)
|
||||
updateScrimOpaque()
|
||||
Trace.traceCounter(Trace.TRACE_TAG_APP, "light_reveal_amount",
|
||||
(field * 100).toInt())
|
||||
invalidate()
|
||||
}
|
||||
}
|
||||
@@ -355,8 +358,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context,
|
||||
}
|
||||
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0
|
||||
|| revealAmount == 0f) {
|
||||
if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0 ||
|
||||
revealAmount == 0f) {
|
||||
if (revealAmount < 1f) {
|
||||
canvas?.drawColor(revealGradientEndColor)
|
||||
}
|
||||
|
||||
@@ -4404,8 +4404,7 @@ public class CentralSurfaces extends CoreStartable implements
|
||||
@Override
|
||||
public void onDozeAmountChanged(float linear, float eased) {
|
||||
if (mFeatureFlags.isEnabled(Flags.LOCKSCREEN_ANIMATIONS)
|
||||
&& !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)
|
||||
&& !mBiometricUnlockController.isWakeAndUnlock()) {
|
||||
&& !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
|
||||
mLightRevealScrim.setRevealAmount(1f - linear);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.android.systemui.animation.Interpolators
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.keyguard.KeyguardViewMediator
|
||||
import com.android.systemui.keyguard.WakefulnessLifecycle
|
||||
import com.android.systemui.statusbar.CircleReveal
|
||||
import com.android.systemui.statusbar.LightRevealScrim
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
import com.android.systemui.statusbar.StatusBarStateControllerImpl
|
||||
@@ -85,7 +86,9 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
duration = LIGHT_REVEAL_ANIMATION_DURATION
|
||||
interpolator = Interpolators.LINEAR
|
||||
addUpdateListener {
|
||||
lightRevealScrim.revealAmount = it.animatedValue as Float
|
||||
if (lightRevealScrim.revealEffect !is CircleReveal) {
|
||||
lightRevealScrim.revealAmount = it.animatedValue as Float
|
||||
}
|
||||
if (lightRevealScrim.isScrimAlmostOccludes &&
|
||||
interactionJankMonitor.isInstrumenting(CUJ_SCREEN_OFF)) {
|
||||
// ends the instrument when the scrim almost occludes the screen.
|
||||
@@ -95,9 +98,9 @@ class UnlockedScreenOffAnimationController @Inject constructor(
|
||||
}
|
||||
addListener(object : AnimatorListenerAdapter() {
|
||||
override fun onAnimationCancel(animation: Animator?) {
|
||||
lightRevealScrim.revealAmount = 1f
|
||||
lightRevealAnimationPlaying = false
|
||||
interactionJankMonitor.cancel(CUJ_SCREEN_OFF)
|
||||
if (lightRevealScrim.revealEffect !is CircleReveal) {
|
||||
lightRevealScrim.revealAmount = 1f
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAnimationEnd(animation: Animator?) {
|
||||
|
||||
Reference in New Issue
Block a user