Remove extra padding in QS header
Fixes: 187069480 Test: manual Change-Id: I5a0e8ab19ec7944b04edf663ba3a1e1e5693b310
This commit is contained in:
@@ -297,9 +297,7 @@ public class QSContainerImpl extends FrameLayout {
|
||||
// start margin of next page).
|
||||
qsPanelController.setPageMargin(2 * mSideMargins);
|
||||
} else if (view == mHeader) {
|
||||
// The header contains the QQS panel which needs to have special padding, to
|
||||
// visually align them.
|
||||
quickStatusBarHeaderController.setContentMargins(mContentPadding, mContentPadding);
|
||||
// No content padding for the header.
|
||||
} else {
|
||||
view.setPaddingRelative(
|
||||
mContentPadding,
|
||||
|
||||
@@ -77,8 +77,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
|
||||
private int mStatusBarPaddingTop = 0;
|
||||
private int mRoundedCornerPadding = 0;
|
||||
private int mContentMarginStart;
|
||||
private int mContentMarginEnd;
|
||||
private int mWaterfallTopInset;
|
||||
private int mCutOutPaddingLeft;
|
||||
private int mCutOutPaddingRight;
|
||||
@@ -370,6 +368,8 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
}
|
||||
|
||||
private void updateHeadersPadding() {
|
||||
setContentMargins(mDatePrivacyView, 0, 0);
|
||||
setContentMargins(mClockIconsView, 0, 0);
|
||||
int paddingLeft = 0;
|
||||
int paddingRight = 0;
|
||||
|
||||
@@ -383,14 +383,12 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
if (mCutOutPaddingLeft > 0) {
|
||||
// if there's a cutout, let's use at least the rounded corner inset
|
||||
int cutoutPadding = Math.max(mCutOutPaddingLeft, mRoundedCornerPadding);
|
||||
int contentMarginLeft = isLayoutRtl() ? mContentMarginEnd : mContentMarginStart;
|
||||
paddingLeft = Math.max(cutoutPadding - contentMarginLeft - leftMargin, 0);
|
||||
paddingLeft = Math.max(cutoutPadding - leftMargin, 0);
|
||||
}
|
||||
if (mCutOutPaddingRight > 0) {
|
||||
// if there's a cutout, let's use at least the rounded corner inset
|
||||
int cutoutPadding = Math.max(mCutOutPaddingRight, mRoundedCornerPadding);
|
||||
int contentMarginRight = isLayoutRtl() ? mContentMarginStart : mContentMarginEnd;
|
||||
paddingRight = Math.max(cutoutPadding - contentMarginRight - rightMargin, 0);
|
||||
paddingRight = Math.max(cutoutPadding - rightMargin, 0);
|
||||
}
|
||||
|
||||
mDatePrivacyView.setPadding(paddingLeft,
|
||||
@@ -411,19 +409,6 @@ public class QuickStatusBarHeader extends FrameLayout {
|
||||
mHeaderQsPanel.setCallback(qsPanelCallback);
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setContentMargins(int marginStart, int marginEnd,
|
||||
QuickQSPanelController quickQSPanelController) {
|
||||
mContentMarginStart = marginStart;
|
||||
mContentMarginEnd = marginEnd;
|
||||
// The clock and QQS are not direct children, but the container should be just a wrapper to
|
||||
// be able to move them together. So we set the margins to the actual views.
|
||||
quickQSPanelController.setContentMargins(0, 0);
|
||||
setContentMargins(mDatePrivacyView, marginStart, marginEnd);
|
||||
setContentMargins(mClockIconsView, marginStart, marginEnd);
|
||||
updateHeadersPadding();
|
||||
}
|
||||
|
||||
private void setContentMargins(View view, int marginStart, int marginEnd) {
|
||||
MarginLayoutParams lp = (MarginLayoutParams) view.getLayoutParams();
|
||||
lp.setMarginStart(marginStart);
|
||||
|
||||
@@ -183,6 +183,7 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader
|
||||
mView.onAttach(mIconManager, mQSExpansionPathInterpolator);
|
||||
|
||||
mDemoModeController.addCallback(mDemoModeReceiver);
|
||||
mHeaderQsPanelController.setContentMargins(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -259,11 +260,6 @@ class QuickStatusBarHeaderController extends ViewController<QuickStatusBarHeader
|
||||
return mMicCameraIndicatorsEnabled || mLocationIndicatorsEnabled;
|
||||
}
|
||||
|
||||
public void setContentMargins(int contentPaddingStart, int contentPaddingEnd) {
|
||||
mView.setContentMargins(contentPaddingStart, contentPaddingEnd, mHeaderQsPanelController);
|
||||
}
|
||||
|
||||
|
||||
private static class ClockDemoModeReceiver implements DemoMode {
|
||||
private Clock mClockView;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user