From e9526a98362b78ba4ebfca105f74c3a1cd4ec95e Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Mon, 16 Apr 2018 20:03:09 +0800 Subject: [PATCH] Only fade clock away at the top of the screen Space can be tight if we fade out at the minimum padding, especially with big font or display size. Test: visual Change-Id: Ic94714354bd1a2510f4603feae153713e23c0dfc Fixes: 77228035 --- .../statusbar/phone/KeyguardClockPositionAlgorithm.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java index 1fb1ddd5e70a9..d9a55c59d21ce 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java @@ -232,8 +232,7 @@ public class KeyguardClockPositionAlgorithm { if (mCurrentlySecure) { alphaKeyguard = 1; } else { - alphaKeyguard = Math.max(0, Math.min(1, (y - mMinTopMargin) - / Math.max(1f, getExpandedClockPosition() - mMinTopMargin))); + alphaKeyguard = Math.max(0, y / Math.max(1f, getExpandedClockPosition())); alphaKeyguard = Interpolators.ACCELERATE.getInterpolation(alphaKeyguard); } return MathUtils.lerp(alphaKeyguard, 1f, mDarkAmount);