diff options
| author | 2025-01-24 17:02:33 -0500 | |
|---|---|---|
| committer | 2025-01-24 17:02:33 -0500 | |
| commit | 5b45249d36d91db2c7bddfe21681bf6f64b8110c (patch) | |
| tree | 928d63d76b41044a0f08148d89b30b1087615976 | |
| parent | abcbc53ad362c63245f3520143062e340d94633c (diff) | |
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
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index cd5c135691d7..bd89f5cf45f6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -394,11 +394,19 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange * Returns the divider position as a fraction from 0 to 1. */ public float getDividerPositionAsFraction() { - return Math.min(1f, Math.max(0f, mIsLeftRightSplit - ? (float) ((getTopLeftBounds().right + getBottomRightBounds().left) / 2f) - / getBottomRightBounds().right - : (float) ((getTopLeftBounds().bottom + getBottomRightBounds().top) / 2f) - / getBottomRightBounds().bottom)); + 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() { |