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

Commit 5b45249d authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Change divider ratio for flex to use display width instead of right app's right bounds.

* BottomRight app's right bound is now offscreen, whereas for the
divider fraction we want the fraction of what is visible on-screen.

Test: Logged reisizing ratios to see the correct value
Bug: 392131500
Flag: com.android.wm.shell.enable_flexible_two_app_split
Change-Id: I0840153983e29b4aa4d131d2f8dbd2f2fb756aa0
parent abcbc53a
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -394,12 +394,20 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
     * Returns the divider position as a fraction from 0 to 1.
     */
    public float getDividerPositionAsFraction() {
        if (Flags.enableFlexibleTwoAppSplit()) {
            return Math.min(1f, Math.max(0f, mIsLeftRightSplit
                    ? (getTopLeftBounds().right + getBottomRightBounds().left) / 2f
                    / getDisplayWidth()
                    : (getTopLeftBounds().bottom + getBottomRightBounds().top) / 2f
                            / getDisplayHeight()));
        } else {
            return Math.min(1f, Math.max(0f, mIsLeftRightSplit
                    ? (float) ((getTopLeftBounds().right + getBottomRightBounds().left) / 2f)
                    / getBottomRightBounds().right
                    : (float) ((getTopLeftBounds().bottom + getBottomRightBounds().top) / 2f)
                            / getBottomRightBounds().bottom));
        }
    }

    private void updateInvisibleRect() {
        mInvisibleBounds.set(mRootBounds.left, mRootBounds.top,