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

Commit 33f6e24b authored by Alp Yalcin's avatar Alp Yalcin
Browse files

[3/n] Create the new window for the torn tab from top-center at drop point

Based on the UX team meeting, it's decided that we're going to use
top-center for new windows' creation in tab tearing.

Flag: com.android.window.flags.enable_interaction_dependent_tab_tearing_bounds
Bug: 436504714
Test: atest WMShellUnitTests:DesktopTasksControllerTest
Change-Id: I440b093621d06ab5b348b763b1f047248e4c0622
parent 5286e0c3
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -5605,16 +5605,15 @@ class DesktopTasksController(
                ) {
                    // Inherit parent's bounds.
                    newWindowBounds.set(taskInfo.configuration.windowConfiguration.bounds)
                    // TODO: (b/436504714) - Implement the new positioning logic here.
                } else {
                    // Use default bounds, but with the top-center at the drop point.
                    newWindowBounds.set(calculateDefaultDesktopTaskBounds(displayLayout))
                }
                // Create the new window from the top-center at the drop point.
                newWindowBounds.offsetTo(
                        dragEvent.x.toInt() - (newWindowBounds.width() / 2),
                        dragEvent.y.toInt(),
                    )
            }
            }
            IndicatorType.TO_SPLIT_RIGHT_INDICATOR -> {
                newWindowBounds.set(getSnapBounds(destinationDisplay, SnapPosition.RIGHT))
            }
+4 −4
Original line number Diff line number Diff line
@@ -10003,7 +10003,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        testOnUnhandledDrag(
            DesktopModeVisualIndicator.IndicatorType.TO_DESKTOP_INDICATOR,
            PointF(1200f, 700f),
            Rect(100, 100, 300, 300),
            Rect(1100, 700, 1300, 900),
            tabTearingMinimizeAnimationFlagEnabled = true,
            tabTearingLaunchAnimationFlagEnabled = true,
        )
@@ -10019,7 +10019,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        testOnUnhandledDrag(
            DesktopModeVisualIndicator.IndicatorType.TO_DESKTOP_INDICATOR,
            PointF(1200f, 700f),
            Rect(100, 100, 300, 300),
            Rect(1100, 700, 1300, 900),
            tabTearingMinimizeAnimationFlagEnabled = true,
            tabTearingLaunchAnimationFlagEnabled = false,
        )
@@ -10035,7 +10035,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        testOnUnhandledDrag(
            DesktopModeVisualIndicator.IndicatorType.TO_DESKTOP_INDICATOR,
            PointF(1200f, 700f),
            Rect(100, 100, 300, 300),
            Rect(1100, 700, 1300, 900),
            tabTearingMinimizeAnimationFlagEnabled = false,
            tabTearingLaunchAnimationFlagEnabled = true,
        )
@@ -10051,7 +10051,7 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        testOnUnhandledDrag(
            DesktopModeVisualIndicator.IndicatorType.TO_DESKTOP_INDICATOR,
            PointF(1200f, 700f),
            Rect(100, 100, 300, 300),
            Rect(1100, 700, 1300, 900),
            tabTearingMinimizeAnimationFlagEnabled = false,
            tabTearingLaunchAnimationFlagEnabled = false,
        )