summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josh Tsuji <tsuji@google.com> 2022-11-17 14:01:13 -0500
committer Josh Tsuji <tsuji@google.com> 2022-11-17 14:01:16 -0500
commit73f8c3ea4cb7236f120d1c389845dc10eed6fccd (patch)
tree07c67875664ba019459ac8e30a7199eaf365bed0
parent3af097687dceeb36ccbd69cdd275a6a2982969e7 (diff)
Fix default occlude animation to scale from 50%, not 0%.
Fixes: 240586745 Test: launch non-camera occluding activity Change-Id: I337bddd3d24947c77ea4e50d78b6f1cd8cd0ed66
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java25
1 files changed, 16 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 7cd3843fd506..54bb164833e8 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -889,25 +889,32 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
@NonNull
@Override
public LaunchAnimator.State createAnimatorState() {
- final int width = getLaunchContainer().getWidth();
- final int height = getLaunchContainer().getHeight();
-
- final float initialHeight = height / 3f;
- final float initialWidth = width / 3f;
+ final int fullWidth = getLaunchContainer().getWidth();
+ final int fullHeight = getLaunchContainer().getHeight();
if (mUpdateMonitor.isSecureCameraLaunchedOverKeyguard()) {
+ final float initialHeight = fullHeight / 3f;
+ final float initialWidth = fullWidth / 3f;
+
// Start the animation near the power button, at one-third size, since the
// camera was launched from the power button.
return new LaunchAnimator.State(
(int) (mPowerButtonY - initialHeight / 2f) /* top */,
(int) (mPowerButtonY + initialHeight / 2f) /* bottom */,
- (int) (width - initialWidth) /* left */,
- width /* right */,
+ (int) (fullWidth - initialWidth) /* left */,
+ fullWidth /* right */,
mWindowCornerRadius, mWindowCornerRadius);
} else {
- // Start the animation in the center of the screen, scaled down.
+ final float initialHeight = fullHeight / 2f;
+ final float initialWidth = fullWidth / 2f;
+
+ // Start the animation in the center of the screen, scaled down to half
+ // size.
return new LaunchAnimator.State(
- height / 2, height / 2, width / 2, width / 2,
+ (int) (fullHeight - initialHeight) / 2,
+ (int) (initialHeight + (fullHeight - initialHeight) / 2),
+ (int) (fullWidth - initialWidth) / 2,
+ (int) (initialWidth + (fullWidth - initialWidth) / 2),
mWindowCornerRadius, mWindowCornerRadius);
}
}