Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea8ea935 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Fix overlap between lock and notif shelf

on dual shade

Test: NotificationPanelViewControllerTest
Test: LockscreenNotificationsOverlapWithLockIcon
Fixes: 289261453
Change-Id: Ie478f675f4b8deb436bd76c352a7691698dbe951
parent 3658b892
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1847,6 +1847,9 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    /** Returns extra space available to show the shelf on lockscreen */
    @VisibleForTesting
    float getVerticalSpaceForLockscreenShelf() {
        if (mSplitShadeEnabled) {
            return 0f;
        }
        final float lockIconPadding = getLockIconPadding();

        final float noShelfOverlapBottomPadding =
+17 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo

    @Test
    public void getVerticalSpaceForLockscreenShelf_useLockIconBottomPadding_returnsShelfHeight() {
        enableSplitShade(/* enabled= */ false);
        setBottomPadding(/* stackScrollLayoutBottom= */ 100,
                /* lockIconPadding= */ 20,
                /* indicationPadding= */ 0,
@@ -209,6 +210,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo

    @Test
    public void getVerticalSpaceForLockscreenShelf_useIndicationBottomPadding_returnsZero() {
        enableSplitShade(/* enabled= */ false);
        setBottomPadding(/* stackScrollLayoutBottom= */ 100,
                /* lockIconPadding= */ 0,
                /* indicationPadding= */ 30,
@@ -221,6 +223,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo

    @Test
    public void getVerticalSpaceForLockscreenShelf_useAmbientBottomPadding_returnsZero() {
        enableSplitShade(/* enabled= */ false);
        setBottomPadding(/* stackScrollLayoutBottom= */ 100,
                /* lockIconPadding= */ 0,
                /* indicationPadding= */ 0,
@@ -233,6 +236,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo

    @Test
    public void getVerticalSpaceForLockscreenShelf_useLockIconPadding_returnsLessThanShelfHeight() {
        enableSplitShade(/* enabled= */ false);
        setBottomPadding(/* stackScrollLayoutBottom= */ 100,
                /* lockIconPadding= */ 10,
                /* indicationPadding= */ 8,
@@ -243,6 +247,19 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo
                .isEqualTo(2);
    }

    @Test
    public void getVerticalSpaceForLockscreenShelf_splitShade() {
        enableSplitShade(/* enabled= */ true);
        setBottomPadding(/* stackScrollLayoutBottom= */ 100,
                /* lockIconPadding= */ 10,
                /* indicationPadding= */ 8,
                /* ambientPadding= */ 0);

        when(mNotificationShelfController.getIntrinsicHeight()).thenReturn(5);
        assertThat(mNotificationPanelViewController.getVerticalSpaceForLockscreenShelf())
                .isEqualTo(0);
    }

    @Test
    public void testSetPanelScrimMinFractionWhenHeadsUpIsDragged() {
        mNotificationPanelViewController.setHeadsUpDraggingStartingHeight(