Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +18 −4 Original line number Diff line number Diff line Loading @@ -195,12 +195,21 @@ public class KeyguardClockPositionAlgorithm { 1.0f /* panelExpansion */, 1.0f /* darkAmount */); result.clockAlpha = getClockAlpha(y); result.stackScrollerPadding = getStackScrollerPadding(y); result.stackScrollerPaddingExpanded = mBypassEnabled ? mUnlockedStackScrollerPadding : getClockY(1.0f, mDarkAmount) + mKeyguardStatusHeight; result.stackScrollerPaddingExpanded = getStackScrollerPaddingExpanded(); result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount); result.clockScale = interpolate(getBurnInScale(), 1.0f, 1.0f - mDarkAmount); } private int getStackScrollerPaddingExpanded() { if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { return getClockY(1.0f, mDarkAmount); } else { return getClockY(1.0f, mDarkAmount) + mKeyguardStatusHeight; } } private int getStackScrollerPadding(int clockYPosition) { if (mBypassEnabled) { return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount); Loading @@ -212,8 +221,13 @@ public class KeyguardClockPositionAlgorithm { } public float getMinStackScrollerPadding() { return mBypassEnabled ? mUnlockedStackScrollerPadding : mMinTopMargin + mKeyguardStatusHeight; if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { return mMinTopMargin; } else { return mMinTopMargin + mKeyguardStatusHeight; } } private int getExpandedPreferredClockY() { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java +24 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { private KeyguardClockPositionAlgorithm.Result mClockPosition; private MockitoSession mStaticMockSession; private int mNotificationStackHeight; private float mPanelExpansion; private int mKeyguardStatusBarHeaderHeight; Loading Loading @@ -263,6 +262,30 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0); } @Test public void notifPaddingExpandedAlignedWithClockInSplitShadeMode() { givenLockScreen(); mIsSplitShade = true; mKeyguardStatusHeight = 200; // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPosition.stackScrollerPaddingExpanded) .isEqualTo(mClockPosition.clockYFullyDozing); } @Test public void notifMinPaddingAlignedWithClockInSplitShadeMode() { givenLockScreen(); mIsSplitShade = true; mKeyguardStatusHeight = 200; // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPositionAlgorithm.getMinStackScrollerPadding()) .isEqualTo(mKeyguardStatusBarHeaderHeight); } @Test public void notifPositionWithLargeClockOnLockScreen() { // GIVEN on lock screen and clock has a nonzero height Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +18 −4 Original line number Diff line number Diff line Loading @@ -195,12 +195,21 @@ public class KeyguardClockPositionAlgorithm { 1.0f /* panelExpansion */, 1.0f /* darkAmount */); result.clockAlpha = getClockAlpha(y); result.stackScrollerPadding = getStackScrollerPadding(y); result.stackScrollerPaddingExpanded = mBypassEnabled ? mUnlockedStackScrollerPadding : getClockY(1.0f, mDarkAmount) + mKeyguardStatusHeight; result.stackScrollerPaddingExpanded = getStackScrollerPaddingExpanded(); result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount); result.clockScale = interpolate(getBurnInScale(), 1.0f, 1.0f - mDarkAmount); } private int getStackScrollerPaddingExpanded() { if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { return getClockY(1.0f, mDarkAmount); } else { return getClockY(1.0f, mDarkAmount) + mKeyguardStatusHeight; } } private int getStackScrollerPadding(int clockYPosition) { if (mBypassEnabled) { return (int) (mUnlockedStackScrollerPadding + mOverStretchAmount); Loading @@ -212,8 +221,13 @@ public class KeyguardClockPositionAlgorithm { } public float getMinStackScrollerPadding() { return mBypassEnabled ? mUnlockedStackScrollerPadding : mMinTopMargin + mKeyguardStatusHeight; if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { return mMinTopMargin; } else { return mMinTopMargin + mKeyguardStatusHeight; } } private int getExpandedPreferredClockY() { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java +24 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,6 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { private KeyguardClockPositionAlgorithm.Result mClockPosition; private MockitoSession mStaticMockSession; private int mNotificationStackHeight; private float mPanelExpansion; private int mKeyguardStatusBarHeaderHeight; Loading Loading @@ -263,6 +262,30 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { assertThat(mClockPosition.stackScrollerPadding).isEqualTo(0); } @Test public void notifPaddingExpandedAlignedWithClockInSplitShadeMode() { givenLockScreen(); mIsSplitShade = true; mKeyguardStatusHeight = 200; // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPosition.stackScrollerPaddingExpanded) .isEqualTo(mClockPosition.clockYFullyDozing); } @Test public void notifMinPaddingAlignedWithClockInSplitShadeMode() { givenLockScreen(); mIsSplitShade = true; mKeyguardStatusHeight = 200; // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPositionAlgorithm.getMinStackScrollerPadding()) .isEqualTo(mKeyguardStatusBarHeaderHeight); } @Test public void notifPositionWithLargeClockOnLockScreen() { // GIVEN on lock screen and clock has a nonzero height Loading