Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class KeyguardClockPositionAlgorithm { } } public float getMinStackScrollerPadding() { public float getLockscreenMinStackScrollerPadding() { if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +28 −2 Original line number Diff line number Diff line Loading @@ -326,6 +326,11 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mShouldUseSplitNotificationShade; // The bottom padding reserved for elements of the keyguard measuring notifications private float mKeyguardNotificationBottomPadding; /** * The top padding from where notification should start in lockscreen. * Should be static also during animations and should match the Y of the first notification. */ private float mKeyguardNotificationTopPadding; // Current max allowed keyguard notifications determined by measuring the panel private int mMaxAllowedKeyguardNotifications; Loading Loading @@ -1514,7 +1519,10 @@ public class NotificationPanelViewController extends PanelViewController { */ @VisibleForTesting float getSpaceForLockscreenNotifications() { float topPadding = mNotificationStackScrollLayoutController.getTopPadding(); float staticTopPadding = mClockPositionAlgorithm.getLockscreenMinStackScrollerPadding() // getMinStackScrollerPadding is from the top of the screen, // but we need it from the top of the NSSL. - mNotificationStackScrollLayoutController.getTop(); // Space between bottom of notifications and top of lock icon or udfps background. float lockIconPadding = mLockIconViewController.getTop(); Loading @@ -1526,11 +1534,15 @@ public class NotificationPanelViewController extends PanelViewController { float bottomPadding = Math.max(lockIconPadding, Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding)); mKeyguardNotificationBottomPadding = bottomPadding; mKeyguardNotificationTopPadding = staticTopPadding; // To debug the available space, enable debug lines in this class. If you change how the // available space is calculated, please also update those lines. float availableSpace = mNotificationStackScrollLayoutController.getHeight() - topPadding - staticTopPadding - bottomPadding; return availableSpace; } Loading Loading @@ -4924,6 +4936,20 @@ public class NotificationPanelViewController extends PanelViewController { drawDebugInfo(canvas, (int) mLockIconViewController.getTop(), Color.GRAY, "mLockIconViewController.getTop()"); if (mKeyguardShowing) { // Notifications have the space between those two lines. drawDebugInfo(canvas, mNotificationStackScrollLayoutController.getTop() + (int) mKeyguardNotificationTopPadding, Color.RED, "NSSL.getTop() + mKeyguardNotificationTopPadding"); drawDebugInfo(canvas, mNotificationStackScrollLayoutController.getBottom() - (int) mKeyguardNotificationBottomPadding, Color.RED, "NSSL.getBottom() - mKeyguardNotificationBottomPadding"); } mDebugPaint.setColor(Color.CYAN); canvas.drawLine(0, mClockPositionResult.stackScrollerPadding, mView.getWidth(), mNotificationStackScrollLayoutController.getTopPadding(), mDebugPaint); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPositionAlgorithm.getMinStackScrollerPadding()) assertThat(mClockPositionAlgorithm.getLockscreenMinStackScrollerPadding()) .isEqualTo(mKeyguardStatusBarHeaderHeight); } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -610,13 +610,13 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { when(mLockIconViewController.getTop()).thenReturn(80f); when(mResources.getDimensionPixelSize(R.dimen.shelf_and_lock_icon_overlap)).thenReturn(5); // Available space (100 - 10 - 15 = 75) // Available space (100 - 0 - 15 = 85) when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(100); when(mNotificationStackScrollLayoutController.getTopPadding()).thenReturn(10); when(mNotificationStackScrollLayoutController.getTop()).thenReturn(0); mNotificationPanelViewController.updateResources(); assertThat(mNotificationPanelViewController.getSpaceForLockscreenNotifications()) .isEqualTo(75); .isEqualTo(85); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class KeyguardClockPositionAlgorithm { } } public float getMinStackScrollerPadding() { public float getLockscreenMinStackScrollerPadding() { if (mBypassEnabled) { return mUnlockedStackScrollerPadding; } else if (mIsSplitShade) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +28 −2 Original line number Diff line number Diff line Loading @@ -326,6 +326,11 @@ public class NotificationPanelViewController extends PanelViewController { private boolean mShouldUseSplitNotificationShade; // The bottom padding reserved for elements of the keyguard measuring notifications private float mKeyguardNotificationBottomPadding; /** * The top padding from where notification should start in lockscreen. * Should be static also during animations and should match the Y of the first notification. */ private float mKeyguardNotificationTopPadding; // Current max allowed keyguard notifications determined by measuring the panel private int mMaxAllowedKeyguardNotifications; Loading Loading @@ -1514,7 +1519,10 @@ public class NotificationPanelViewController extends PanelViewController { */ @VisibleForTesting float getSpaceForLockscreenNotifications() { float topPadding = mNotificationStackScrollLayoutController.getTopPadding(); float staticTopPadding = mClockPositionAlgorithm.getLockscreenMinStackScrollerPadding() // getMinStackScrollerPadding is from the top of the screen, // but we need it from the top of the NSSL. - mNotificationStackScrollLayoutController.getTop(); // Space between bottom of notifications and top of lock icon or udfps background. float lockIconPadding = mLockIconViewController.getTop(); Loading @@ -1526,11 +1534,15 @@ public class NotificationPanelViewController extends PanelViewController { float bottomPadding = Math.max(lockIconPadding, Math.max(mIndicationBottomPadding, mAmbientIndicationBottomPadding)); mKeyguardNotificationBottomPadding = bottomPadding; mKeyguardNotificationTopPadding = staticTopPadding; // To debug the available space, enable debug lines in this class. If you change how the // available space is calculated, please also update those lines. float availableSpace = mNotificationStackScrollLayoutController.getHeight() - topPadding - staticTopPadding - bottomPadding; return availableSpace; } Loading Loading @@ -4924,6 +4936,20 @@ public class NotificationPanelViewController extends PanelViewController { drawDebugInfo(canvas, (int) mLockIconViewController.getTop(), Color.GRAY, "mLockIconViewController.getTop()"); if (mKeyguardShowing) { // Notifications have the space between those two lines. drawDebugInfo(canvas, mNotificationStackScrollLayoutController.getTop() + (int) mKeyguardNotificationTopPadding, Color.RED, "NSSL.getTop() + mKeyguardNotificationTopPadding"); drawDebugInfo(canvas, mNotificationStackScrollLayoutController.getBottom() - (int) mKeyguardNotificationBottomPadding, Color.RED, "NSSL.getBottom() - mKeyguardNotificationBottomPadding"); } mDebugPaint.setColor(Color.CYAN); canvas.drawLine(0, mClockPositionResult.stackScrollerPadding, mView.getWidth(), mNotificationStackScrollLayoutController.getTopPadding(), mDebugPaint); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,7 @@ public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase { // WHEN the position algorithm is run positionClock(); // THEN the padding DOESN'T adjust for keyguard status height. assertThat(mClockPositionAlgorithm.getMinStackScrollerPadding()) assertThat(mClockPositionAlgorithm.getLockscreenMinStackScrollerPadding()) .isEqualTo(mKeyguardStatusBarHeaderHeight); } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -610,13 +610,13 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { when(mLockIconViewController.getTop()).thenReturn(80f); when(mResources.getDimensionPixelSize(R.dimen.shelf_and_lock_icon_overlap)).thenReturn(5); // Available space (100 - 10 - 15 = 75) // Available space (100 - 0 - 15 = 85) when(mNotificationStackScrollLayoutController.getHeight()).thenReturn(100); when(mNotificationStackScrollLayoutController.getTopPadding()).thenReturn(10); when(mNotificationStackScrollLayoutController.getTop()).thenReturn(0); mNotificationPanelViewController.updateResources(); assertThat(mNotificationPanelViewController.getSpaceForLockscreenNotifications()) .isEqualTo(75); .isEqualTo(85); } @Test Loading