From 428914d0f07f4a0d5b55c4de7ec30708505bd21f Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 30 Mar 2016 09:35:36 -0400 Subject: [PATCH] Remove panel paddings/margins when QS is customizing Otherwise notifications refuse to move out of the way for QS editing and it gets drawn on top of. Bug: 27835052 Change-Id: I65db22899b295e8ab14594b18560ca822e5fe02b --- .../systemui/qs/customize/QSCustomizer.java | 2 ++ .../NotificationsQuickSettingsContainer.java | 26 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java index aeca8401633a8..dbfa1c5f43ab8 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java @@ -122,6 +122,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene mClipper.animateCircularClip(x, y, true, mExpandAnimationListener); new TileQueryHelper(mContext, mHost).setListener(mTileAdapter); mNotifQsContainer.setCustomizerAnimating(true); + mNotifQsContainer.setCustomizerShowing(true); } } @@ -133,6 +134,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene save(); mClipper.animateCircularClip(x, y, false, mCollapseAnimationListener); mNotifQsContainer.setCustomizerAnimating(true); + mNotifQsContainer.setCustomizerShowing(false); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java index 960515b9137a0..35fb2a50306e8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationsQuickSettingsContainer.java @@ -35,6 +35,7 @@ import com.android.systemui.qs.customize.QSCustomizer; public class NotificationsQuickSettingsContainer extends FrameLayout implements ViewStub.OnInflateListener, DensityContainer.InflateListener { + private DensityContainer mQsContainer; private View mUserSwitcher; private View mStackScroller; @@ -43,6 +44,9 @@ public class NotificationsQuickSettingsContainer extends FrameLayout private boolean mQsExpanded; private boolean mCustomizerAnimating; + private int mBottomPadding; + private int mStackScrollerMargin; + public NotificationsQuickSettingsContainer(Context context, AttributeSet attrs) { super(context, attrs); } @@ -53,6 +57,7 @@ public class NotificationsQuickSettingsContainer extends FrameLayout mQsContainer = (DensityContainer) findViewById(R.id.qs_density_container); mQsContainer.addInflateListener(this); mStackScroller = findViewById(R.id.notification_stack_scroller); + mStackScrollerMargin = ((LayoutParams) mStackScroller.getLayoutParams()).bottomMargin; mKeyguardStatusBar = findViewById(R.id.keyguard_header); ViewStub userSwitcher = (ViewStub) findViewById(R.id.keyguard_user_switcher); userSwitcher.setOnInflateListener(this); @@ -75,7 +80,8 @@ public class NotificationsQuickSettingsContainer extends FrameLayout @Override public WindowInsets onApplyWindowInsets(WindowInsets insets) { - setPadding(0, 0, 0, insets.getStableInsetBottom()); + mBottomPadding = insets.getStableInsetBottom(); + setPadding(0, 0, 0, mBottomPadding); return insets; } @@ -141,4 +147,22 @@ public class NotificationsQuickSettingsContainer extends FrameLayout invalidate(); } } + + public void setCustomizerShowing(boolean isShowing) { + if (isShowing) { + // Clear out bottom paddings/margins so the qs customization can be full height. + setPadding(0, 0, 0, 0); + setBottomMargin(mStackScroller, 0); + } else { + setPadding(0, 0, 0, mBottomPadding); + setBottomMargin(mStackScroller, mStackScrollerMargin); + } + + } + + private void setBottomMargin(View v, int bottomMargin) { + LayoutParams params = (LayoutParams) v.getLayoutParams(); + params.bottomMargin = bottomMargin; + v.setLayoutParams(params); + } }