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