Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a958d3f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Ensure QS does not expand when qs disabled." into pi-dev

parents a2f4dd1c e04505e8
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -100,16 +100,6 @@ public class QSContainerImpl extends FrameLayout {

    @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.
@@ -139,8 +129,7 @@ public class QSContainerImpl extends FrameLayout {
        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() {
+10 −11
Original line number Diff line number Diff line
@@ -105,6 +105,13 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
            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
@@ -203,15 +210,13 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
                : 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() {
@@ -278,12 +283,6 @@ public class QSFragment extends Fragment implements QS, CommandQueue.Callbacks {
        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