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

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

Merge "Cache display height in QSContainerImpl." into pi-dev am: 26f00b9d

am: 1046d859

Change-Id: Idd9dea5365fc9ed50912b93916aed2a56ffb68c6
parents 11ed0379 1046d859
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class QSContainerImpl extends FrameLayout {
        }

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

    @Override
@@ -123,9 +124,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
@@ -197,4 +197,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;
    }
}