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

Commit 5c65febb authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Ensure that the Hotseat respects the margins of the QSB.

Before this change they were ignored by onMeasure(), so that the QSB
couldn't rely on margins for its positioning.

Bug: 217477426
Test: manual
Change-Id: Ifecd3d40ea584273b7857d19b25a90dbafe1c656
(cherry picked from commit 410c75a4)
parent e4796198
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -173,9 +173,15 @@ public class Hotseat extends CellLayout implements Insettable {
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);

        int width = mActivity.getDeviceProfile().isQsbInline
                ? mActivity.getDeviceProfile().qsbWidth
                : getShortcutsAndWidgets().getMeasuredWidth();
        int width;
        if (mActivity.getDeviceProfile().isQsbInline) {
            width = mActivity.getDeviceProfile().qsbWidth;
        } else {
            MarginLayoutParams qsbParams = (MarginLayoutParams) mQsb.getLayoutParams();
            width = getShortcutsAndWidgets().getMeasuredWidth()
                    - qsbParams.getMarginStart()
                    - qsbParams.getMarginEnd();
        }

        mQsb.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
                MeasureSpec.makeMeasureSpec(mQsbHeight, MeasureSpec.EXACTLY));