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

Commit bab735f9 authored by Amin Shaikh's avatar Amin Shaikh Committed by android-build-merger
Browse files

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

am: 3a958d3f

Change-Id: Ic867d2e75945b27b82ffc5d62202371ee72321e9
parents 765a015f 3a958d3f
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