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

Commit 2c5baca5 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix panel height when only one notification is shown

Also fix the place holder height for the stack when QS is expanded.

Change-Id: Ia28373c21b5d2155e735425d5657dde2dec49c6d
parent 7c940e94
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -232,8 +232,9 @@
    <!-- Space reserved for the cards behind the top card in the bottom stack -->
    <dimen name="bottom_stack_peek_amount">12dp</dimen>

    <!-- bottom_stack_peek_amount + notification_min_height -->
    <dimen name="min_stack_height">76dp</dimen>
    <!-- bottom_stack_peek_amount + notification_min_height
         + notification_collapse_second_card_padding -->
    <dimen name="min_stack_height">84dp</dimen>

    <!-- The height of the area before the bottom stack in which the notifications slow down -->
    <dimen name="bottom_stack_slow_down_length">12dp</dimen>
+5 −4
Original line number Diff line number Diff line
@@ -1317,7 +1317,8 @@ public class NotificationStackScrollLayout extends ViewGroup
    }

    public int getPeekHeight() {
        return mIntrinsicPadding + mCollapsedSize + mBottomStackPeekSize;
        return mIntrinsicPadding + mCollapsedSize + mBottomStackPeekSize
                + mCollapseSecondCardPadding;
    }

    private int clampPadding(int desiredPadding) {
@@ -1795,11 +1796,11 @@ public class NotificationStackScrollLayout extends ViewGroup
    }

    public int getEmptyBottomMargin() {
        int emptyMargin = mMaxLayoutHeight - mContentHeight;
        int emptyMargin = mMaxLayoutHeight - mContentHeight - mBottomStackPeekSize;
        if (needsHeightAdaption()) {
            emptyMargin = emptyMargin - mBottomStackSlowDownHeight - mBottomStackPeekSize;
            emptyMargin -= mBottomStackSlowDownHeight;
        } else {
            emptyMargin = emptyMargin - mBottomStackPeekSize;
            emptyMargin -= mCollapseSecondCardPadding;
        }
        return Math.max(emptyMargin, 0);
    }