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
This commit is contained in:
Lucas Dupin
2018-04-16 20:03:09 +08:00
parent 2e79c79ecd
commit e9526a9836

View File

@@ -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);