Merge "Fix margins in QSDetail" into sc-dev am: 60ce5b2dab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15067098 Change-Id: I186af738eb23dc8007db2337e163fb735bee393b
This commit is contained in:
@@ -46,6 +46,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.qs.DetailAdapter;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.phone.NotificationsQuickSettingsContainer;
|
||||
|
||||
public class QSDetail extends LinearLayout {
|
||||
|
||||
@@ -83,6 +84,8 @@ public class QSDetail extends LinearLayout {
|
||||
private boolean mSwitchState;
|
||||
private QSFooter mFooter;
|
||||
|
||||
private NotificationsQuickSettingsContainer mContainer;
|
||||
|
||||
public QSDetail(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
@@ -115,6 +118,10 @@ public class QSDetail extends LinearLayout {
|
||||
mClipper = new QSDetailClipper(this);
|
||||
}
|
||||
|
||||
public void setContainer(NotificationsQuickSettingsContainer container) {
|
||||
mContainer = container;
|
||||
}
|
||||
|
||||
/** */
|
||||
public void setQsPanel(QSPanelController panelController, QuickStatusBarHeader header,
|
||||
QSFooter footer) {
|
||||
@@ -242,6 +249,9 @@ public class QSDetail extends LinearLayout {
|
||||
}
|
||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
|
||||
animateDetailVisibleDiff(x, y, visibleDiff, listener);
|
||||
if (mContainer != null) {
|
||||
mContainer.setDetailShowing(showingDetail);
|
||||
}
|
||||
}
|
||||
|
||||
protected void animateDetailVisibleDiff(int x, int y, boolean visibleDiff, AnimatorListener listener) {
|
||||
|
||||
@@ -293,6 +293,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
public void setContainer(ViewGroup container) {
|
||||
if (container instanceof NotificationsQuickSettingsContainer) {
|
||||
mQSCustomizerController.setContainer((NotificationsQuickSettingsContainer) container);
|
||||
mQSDetail.setContainer((NotificationsQuickSettingsContainer) container);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
|
||||
private View mKeyguardStatusBar;
|
||||
private boolean mQsExpanded;
|
||||
private boolean mCustomizerAnimating;
|
||||
private boolean mCustomizing;
|
||||
private boolean mDetailShowing;
|
||||
|
||||
private int mBottomPadding;
|
||||
private int mStackScrollerMargin;
|
||||
@@ -140,7 +142,18 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
|
||||
}
|
||||
|
||||
public void setCustomizerShowing(boolean isShowing) {
|
||||
if (isShowing) {
|
||||
mCustomizing = isShowing;
|
||||
updateBottomMargin();
|
||||
mStackScroller.setQsCustomizerShowing(isShowing);
|
||||
}
|
||||
|
||||
public void setDetailShowing(boolean isShowing) {
|
||||
mDetailShowing = isShowing;
|
||||
updateBottomMargin();
|
||||
}
|
||||
|
||||
private void updateBottomMargin() {
|
||||
if (mCustomizing || mDetailShowing) {
|
||||
// Clear out bottom paddings/margins so the qs customization can be full height.
|
||||
setPadding(0, 0, 0, 0);
|
||||
setBottomMargin(mStackScroller, 0);
|
||||
@@ -148,7 +161,6 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
|
||||
setPadding(0, 0, 0, mBottomPadding);
|
||||
setBottomMargin(mStackScroller, mStackScrollerMargin);
|
||||
}
|
||||
mStackScroller.setQsCustomizerShowing(isShowing);
|
||||
}
|
||||
|
||||
private void setBottomMargin(View v, int bottomMargin) {
|
||||
|
||||
Reference in New Issue
Block a user