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

Commit e3e99b28 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Fix overlap between lock and notif shelf" into main

parents 9590d058 ea8ea935
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1842,6 +1842,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(