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

Commit d7768f4f authored by Selim Cinek's avatar Selim Cinek
Browse files

Added padding between notifications and qs on lockscreen

With the side paddings it looked odd not to have paddings.

Test: add notification expand on qs, observe padding
Bug: 69168591
Change-Id: Id98763d8aec8cac7f9a60107a03d0669ce86ba71
parent 515b2035
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -225,6 +225,9 @@
         etc. -->
    <dimen name="qs_footer_height">48dp</dimen>

    <!-- The padding between the notifications and the quick settings container -->
    <dimen name="qs_notification_keyguard_padding">8dp</dimen>

    <!-- Height of the status bar header bar when expanded -->
    <dimen name="status_bar_header_height_expanded">124dp</dimen>

+11 −12
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ public class NotificationPanelView extends PanelView implements
    private ValueAnimator mDarkAnimator;
    private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
    private boolean mUserSetupComplete;
    private int mQsNotificationTopPadding;

    public NotificationPanelView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -307,6 +308,8 @@ public class NotificationPanelView extends PanelView implements
                R.dimen.max_notification_fadeout_height);
        mIndicationBottomPadding = getResources().getDimensionPixelSize(
                R.dimen.keyguard_indication_bottom_padding);
        mQsNotificationTopPadding = getResources().getDimensionPixelSize(
                R.dimen.qs_notification_keyguard_padding);
    }

    public void updateResources() {
@@ -818,7 +821,7 @@ public class NotificationPanelView extends PanelView implements

    private float getQsExpansionFraction() {
        return Math.min(1f, (mQsExpansionHeight - mQsMinExpansionHeight)
                / (getTempQsMaxExpansion() - mQsMinExpansionHeight));
                / (mQsMaxExpansionHeight - mQsMinExpansionHeight));
    }

    @Override
@@ -1361,7 +1364,7 @@ public class NotificationPanelView extends PanelView implements
            // take the maximum and linearly interpolate with the panel expansion for a nice motion.
            int maxNotifications = mClockPositionResult.stackScrollerPadding
                    - mClockPositionResult.stackScrollerPaddingAdjustment;
            int maxQs = getTempQsMaxExpansion();
            int maxQs = mQsMaxExpansionHeight + mQsNotificationTopPadding;
            int max = mStatusBarState == StatusBarState.KEYGUARD
                    ? Math.max(maxNotifications, maxQs)
                    : maxQs;
@@ -1375,7 +1378,7 @@ public class NotificationPanelView extends PanelView implements
            // from a scrolled quick settings.
            return interpolate(getQsExpansionFraction(),
                    mNotificationStackScroller.getIntrinsicPadding(),
                    mQsMaxExpansionHeight);
                    mQsMaxExpansionHeight + mQsNotificationTopPadding);
        } else {
            return mQsExpansionHeight;
        }
@@ -1544,7 +1547,7 @@ public class NotificationPanelView extends PanelView implements
                        / (panelHeightQsExpanded - panelHeightQsCollapsed);
            }
            setQsExpansion(mQsMinExpansionHeight
                    + t * (getTempQsMaxExpansion() - mQsMinExpansionHeight));
                    + t * (mQsMaxExpansionHeight - mQsMinExpansionHeight));
        }
        updateExpandedHeight(expandedHeight);
        updateHeader();
@@ -1566,14 +1569,6 @@ public class NotificationPanelView extends PanelView implements
        }
    }

    /**
     * @return a temporary override of {@link #mQsMaxExpansionHeight}, which is needed when
     *         collapsing QS / the panel when QS was scrolled
     */
    private int getTempQsMaxExpansion() {
        return mQsMaxExpansionHeight;
    }

    private int calculatePanelHeightShade() {
        int emptyBottomMargin = mNotificationStackScroller.getEmptyBottomMargin();
        int maxHeight = mNotificationStackScroller.getHeight() - emptyBottomMargin
@@ -1596,6 +1591,10 @@ public class NotificationPanelView extends PanelView implements
        }
        int maxQsHeight = mQsMaxExpansionHeight;

        if (mKeyguardShowing) {
            maxQsHeight += mQsNotificationTopPadding;
        }

        // If an animation is changing the size of the QS panel, take the animated value.
        if (mQsSizeChangeAnimator != null) {
            maxQsHeight = (int) mQsSizeChangeAnimator.getAnimatedValue();