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

Commit 1eb9326e authored by Candice Lo's avatar Candice Lo Committed by Android (Google) Code Review
Browse files

Merge changes I6e965d86,Icb43e7ea into main

* changes:
  fix(window magnification): allow width and height to become full
  fix(window magnification): Create flag for redesigning magnification window size
parents bb01a27e 6825546f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -72,6 +72,16 @@ flag {
    bug: "281140482"
}

flag {
    name: "redesign_magnifier_window_size"
    namespace: "accessibility"
    description: "Redesigns the window magnification magnifier sizes provided in the settings panel."
    bug: "288056772"
    metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "save_and_restore_magnification_settings_buttons"
    namespace: "accessibility"
+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);