From 9c556fe638f87527d3b6b40f2f5f5ff2a1788982 Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Tue, 27 Oct 2020 13:32:48 -0400 Subject: [PATCH] Switch to SystemUI dimen for notification margins. In an upcoming review, I'll be updating notification_content_margin_start to 56dp (while leaving _end at 16dp). This is for an intended asymmetry in the new notification design, but was causing unintended asymmetry in Quick Settings and notification guts. Test: atest SystemUITests Test: manual inspection Change-Id: Ic2c4f4ffe0aa9f2e4caee8e6e85bf65435b9d969 --- core/res/res/values/dimens.xml | 3 --- core/res/res/values/symbols.xml | 1 - .../SystemUI/res/layout/notification_info.xml | 4 ++-- .../res/layout/partial_conversation_info.xml | 4 ++-- packages/SystemUI/res/values/dimens.xml | 3 +++ .../android/systemui/qs/QSContainerImpl.java | 18 ++++++++---------- 6 files changed, 15 insertions(+), 18 deletions(-) diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index 84e7d42f2ed9d..7eff3d7bcb06a 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -207,9 +207,6 @@ 16dp - - 16dp - 16dp diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index a716875b068f3..e4a4e20ee0bb3 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2864,7 +2864,6 @@ - diff --git a/packages/SystemUI/res/layout/notification_info.xml b/packages/SystemUI/res/layout/notification_info.xml index 0a33d5e4429bc..b2c968c0292d2 100644 --- a/packages/SystemUI/res/layout/notification_info.xml +++ b/packages/SystemUI/res/layout/notification_info.xml @@ -24,7 +24,7 @@ android:clipChildren="false" android:clipToPadding="true" android:orientation="vertical" - android:paddingStart="@*android:dimen/notification_content_margin_start"> + android:paddingStart="@dimen/notification_shade_content_margin_horizontal"> android:id="@+id/inline_controls" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingEnd="@*android:dimen/notification_content_margin_end" + android:paddingEnd="@dimen/notification_shade_content_margin_horizontal" android:layout_marginTop="@dimen/notification_guts_option_vertical_padding" android:clipChildren="false" android:clipToPadding="false" diff --git a/packages/SystemUI/res/layout/partial_conversation_info.xml b/packages/SystemUI/res/layout/partial_conversation_info.xml index af66f8ba4cd63..9ed3f92a7d74a 100644 --- a/packages/SystemUI/res/layout/partial_conversation_info.xml +++ b/packages/SystemUI/res/layout/partial_conversation_info.xml @@ -24,7 +24,7 @@ android:clipChildren="false" android:clipToPadding="true" android:orientation="vertical" - android:paddingStart="@*android:dimen/notification_content_margin_start"> + android:paddingStart="@dimen/notification_shade_content_margin_horizontal"> + + 16dp + @*android:dimen/notification_content_margin_top diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java index 8e0e4ac7c8eff..a35151068bee4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java @@ -71,8 +71,7 @@ public class QSContainerImpl extends FrameLayout { private int mSideMargins; private boolean mQsDisabled; - private int mContentPaddingStart = -1; - private int mContentPaddingEnd = -1; + private int mContentPadding = -1; private boolean mAnimateBottomOnNextLayout; public QSContainerImpl(Context context, AttributeSet attrs) { @@ -206,10 +205,9 @@ public class QSContainerImpl extends FrameLayout { mSideMargins = getResources().getDimensionPixelSize(R.dimen.notification_side_paddings); int padding = getResources().getDimensionPixelSize( - com.android.internal.R.dimen.notification_shade_content_margin_horizontal); - boolean marginsChanged = padding != mContentPaddingStart || padding != mContentPaddingEnd; - mContentPaddingStart = padding; - mContentPaddingEnd = padding; + R.dimen.notification_shade_content_margin_horizontal); + boolean marginsChanged = padding != mContentPadding; + mContentPadding = padding; if (marginsChanged) { updatePaddingsAndMargins(); } @@ -290,19 +288,19 @@ public class QSContainerImpl extends FrameLayout { lp.leftMargin = mSideMargins; if (view == mQSPanelContainer) { // QS panel lays out some of its content full width - mQSPanel.setContentMargins(mContentPaddingStart, mContentPaddingEnd); + mQSPanel.setContentMargins(mContentPadding, mContentPadding); Pair margins = mQSPanel.getVisualSideMargins(); // Apply paddings based on QSPanel mQSCustomizer.setContentPaddings(margins.first, margins.second); } else if (view == mHeader) { // The header contains the QQS panel which needs to have special padding, to // visually align them. - mHeader.setContentMargins(mContentPaddingStart, mContentPaddingEnd); + mHeader.setContentMargins(mContentPadding, mContentPadding); } else { view.setPaddingRelative( - mContentPaddingStart, + mContentPadding, view.getPaddingTop(), - mContentPaddingEnd, + mContentPadding, view.getPaddingBottom()); } }