@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- if (mQsDisabled) {
- // Only show the status bar contents in QQS header when QS is disabled.
- mHeader.measure(widthMeasureSpec, heightMeasureSpec);
- LayoutParams layoutParams = (LayoutParams) mHeader.getLayoutParams();
- int height = layoutParams.topMargin + layoutParams.bottomMargin
- + mHeader.getMeasuredHeight();
- super.onMeasure(
- widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
- return;
- }
// Since we control our own bottom, be whatever size we want.
// Otherwise the QSPanel ends up with 0 height when the window is only the
// size of the status bar.
if (disabled == mQsDisabled) return;
mQsDisabled = disabled;
mBackgroundGradient.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
- mQSPanel.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
- mQSFooter.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
+ mBackground.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
}
private void updateResources() {
mQSCustomizer.setEditLocation(x, y);
mQSCustomizer.restoreInstanceState(savedInstanceState);
}
+ SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).addCallbacks(this);
+ }
+
+ @Override
+ public void onDestroyView() {
+ SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).removeCallbacks(this);
+ super.onDestroyView();
}
@Override
: View.INVISIBLE);
mHeader.setExpanded((mKeyguardShowing && !mHeaderAnimating)
|| (mQsExpanded && !mStackScrollerOverscrolling));
- mFooter.setVisibility((mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
+ mFooter.setVisibility(
+ !mQsDisabled && (mQsExpanded || !mKeyguardShowing || mHeaderAnimating)
? View.VISIBLE
: View.INVISIBLE);
- if (mQsDisabled) {
- mFooter.setVisibility(View.GONE);
- }
mFooter.setExpanded((mKeyguardShowing && !mHeaderAnimating)
|| (mQsExpanded && !mStackScrollerOverscrolling));
- mQSPanel.setVisibility(expandVisually ? View.VISIBLE : View.INVISIBLE);
+ mQSPanel.setVisibility(!mQsDisabled && expandVisually ? View.VISIBLE : View.INVISIBLE);
}
public QSPanel getQsPanel() {
mHeader.setListening(listening);
mFooter.setListening(listening);
mQSPanel.setListening(mListening && mQsExpanded);
- if (listening) {
- SysUiServiceProvider.getComponent(getContext(), CommandQueue.class).addCallbacks(this);
- } else {
- SysUiServiceProvider.getComponent(getContext(), CommandQueue.class)
- .removeCallbacks(this);
- }
}
@Override