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

Commit 2938c003 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change divider ratio for flex to use display width instead of right...

Merge "Change divider ratio for flex to use display width instead of right app's right bounds." into main
parents 2d969f3d 5b45249d
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,