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

Commit 6825546f authored by Candice's avatar Candice
Browse files

fix(window magnification): allow width and height to become full

Bug: 288056772
Test: manual
      atest WindowMagnificationControllerWindowlessMagnifierTest
Flag: com.android.systemui.redesign_magnifier_window_size
Change-Id: I6e965d8680ab9381261a9b208c78bd45a002e019
parent fcbe9e10
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -1631,8 +1631,23 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
        boolean bRTL = isRTL(mContext);
        final int initSize = Math.min(mWindowBounds.width(), mWindowBounds.height()) / 3;

        final int maxHeightSize = mWindowBounds.height() - 2 * mMirrorSurfaceMargin;
        final int maxWidthSize = mWindowBounds.width() - 2 * mMirrorSurfaceMargin;
        int maxHeightSize;
        int maxWidthSize;
        if (Flags.redesignMagnifierWindowSize()) {
            // mOuterBorderSize = transparent margin area
            // mMirrorSurfaceMargin = transparent margin area + orange border width
            // We would like to allow the width and height to be full size. Therefore, the max
            // frame size could be calculated as (window bounds - 2 * orange border width).
            maxHeightSize =
                    mWindowBounds.height() - 2 * (mMirrorSurfaceMargin - mOuterBorderSize);
            maxWidthSize  =
                    mWindowBounds.width() - 2 * (mMirrorSurfaceMargin - mOuterBorderSize);
        } else {
            maxHeightSize =
                    mWindowBounds.height() - 2 * mMirrorSurfaceMargin;
            maxWidthSize  =
                    mWindowBounds.width() - 2 * mMirrorSurfaceMargin;
        }

        Rect tempRect = new Rect();
        tempRect.set(mMagnificationFrame);