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

Commit 375b8dd5 authored by Amin Shaikh's avatar Amin Shaikh
Browse files

Cache display height in QSContainerImpl.

Change-Id: If1d7ba59476afadd022ece328bc4303c603bba26
Fixes: 77831576
Test: manual
parent c22605fa
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -20,11 +20,9 @@ import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Point;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.FrameLayout;

import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.qs.customize.QSCustomizer;

@@ -85,6 +83,7 @@ public class QSContainerImpl extends FrameLayout {
        }

        updateResources();
        mSizePoint.set(0, 0); // Will be retrieved on next measure pass.
    }

    @Override
@@ -110,9 +109,8 @@ public class QSContainerImpl extends FrameLayout {

        // QSCustomizer will always be the height of the screen, but do this after
        // other measuring to avoid changing the height of the QS.
        getDisplay().getRealSize(mSizePoint);
        mQSCustomizer.measure(widthMeasureSpec,
                MeasureSpec.makeMeasureSpec(mSizePoint.y, MeasureSpec.EXACTLY));
                MeasureSpec.makeMeasureSpec(getDisplayHeight(), MeasureSpec.EXACTLY));
    }

    @Override
@@ -175,4 +173,11 @@ public class QSContainerImpl extends FrameLayout {
        lp.rightMargin = mSideMargins;
        lp.leftMargin = mSideMargins;
    }

    private int getDisplayHeight() {
        if (mSizePoint.y == 0) {
            getDisplay().getRealSize(mSizePoint);
        }
        return mSizePoint.y;
    }
}