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

Commit 455fb0f1 authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Android (Google) Code Review
Browse files

Merge "Increasing top padding for notifications in split shade mode" into sc-dev

parents 733c9568 eb9b254e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -40,4 +40,9 @@
    <dimen name="qs_tile_margin_top">32dp</dimen>
    <dimen name="qs_brightness_padding_top">6dp</dimen>
    <dimen name="qs_detail_margin_top">28dp</dimen>

    <!-- In split shade mode notifications should be aligned to QS header so the value should be
     adjusted to qs header height and height of centered content inside of it:
    (quick_qs_offset_height (48dp) - ongoing_appops_chip_height (24dp) ) / 2 -->
    <dimen name="notifications_top_padding_split_shade">12dp</dimen>
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -426,6 +426,11 @@
    <!-- The padding between the notifications and the quick settings container -->
    <dimen name="qs_notification_padding">@dimen/notification_side_paddings</dimen>

    <!-- In split shade mode notifications should be aligned to QS header so the value should be
         adjusted to qs header height and height of centered content inside of it:
        (quick_qs_offset_height (60dp)  - ongoing_appops_chip_height (24dp) ) / 2 -->
    <dimen name="notifications_top_padding_split_shade">18dp</dimen>

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

+9 −5
Original line number Diff line number Diff line
@@ -363,6 +363,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private float mDownX;
    private float mDownY;
    private int mDisplayCutoutTopInset = 0; // in pixels
    private int mSplitShadeNotificationsTopPadding;

    private final KeyguardClockPositionAlgorithm
            mClockPositionAlgorithm =
@@ -847,6 +848,8 @@ public class NotificationPanelViewController extends PanelViewController {
    }

    public void updateResources() {
        mSplitShadeNotificationsTopPadding =
                mResources.getDimensionPixelSize(R.dimen.notifications_top_padding_split_shade);
        int qsWidth = mResources.getDimensionPixelSize(R.dimen.qs_panel_width);
        int panelWidth = mResources.getDimensionPixelSize(R.dimen.notification_panel_width);
        mShouldUseSplitNotificationShade =
@@ -2019,10 +2022,9 @@ public class NotificationPanelViewController extends PanelViewController {
        }
    }

    private float calculateQsTopPadding() {
        // in split shade mode we want notifications to be directly below status bar
    private float calculateNotificationsTopPadding() {
        if (mShouldUseSplitNotificationShade && !mKeyguardShowing) {
            return 0f;
            return mSplitShadeNotificationsTopPadding;
        }
        if (mKeyguardShowing && (mQsExpandImmediate
                || mIsExpanding && mQsExpandedWhenExpandingStarted)) {
@@ -2076,7 +2078,8 @@ public class NotificationPanelViewController extends PanelViewController {


    protected void requestScrollerTopPaddingUpdate(boolean animate) {
        mNotificationStackScrollLayoutController.updateTopPadding(calculateQsTopPadding(), animate);
        mNotificationStackScrollLayoutController.updateTopPadding(
                calculateNotificationsTopPadding(), animate);
        if (mKeyguardShowing && mKeyguardBypassController.getBypassEnabled()) {
            // update the position of the header
            updateQsExpansion();
@@ -4056,7 +4059,8 @@ public class NotificationPanelViewController extends PanelViewController {
                    calculatePanelHeightShade(), p);
            p.setColor(Color.MAGENTA);
            canvas.drawLine(
                    0, calculateQsTopPadding(), mView.getWidth(), calculateQsTopPadding(), p);
                    0, calculateNotificationsTopPadding(), mView.getWidth(),
                    calculateNotificationsTopPadding(), p);
            p.setColor(Color.CYAN);
            canvas.drawLine(0, mClockPositionResult.stackScrollerPadding, mView.getWidth(),
                    mNotificationStackScrollLayoutController.getTopPadding(), p);