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

Commit 99ec2739 authored by mattsziklay's avatar mattsziklay
Browse files

Swap freeform vs non-freeform TO_FULLSCREEN heights.

Switches the heights used to determine the TO_FULLSCREEN drag zone to be
in line with the spec: when in freeform, use the 40dp value, otherwise
base it off status bar height.

Similarly, uses the status bar height for beginning drag-to-desktop
transition.

Bug: 329013327
Test: Manual; confirm heights are swapped when dragging in fullscreen
zone.

Change-Id: Iaa2d3fc35ba92d03522140537b817f808748f367
parent d7e8d00a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -138,9 +138,9 @@ public class DesktopModeVisualIndicator {
            @WindowConfiguration.WindowingMode int windowingMode, int captionHeight) {
        final Region region = new Region();
        int transitionHeight = windowingMode == WINDOWING_MODE_FREEFORM
                ? 2 * layout.stableInsets().top
                : mContext.getResources().getDimensionPixelSize(
                        com.android.wm.shell.R.dimen.desktop_mode_fullscreen_from_desktop_height);
                ? mContext.getResources().getDimensionPixelSize(
                com.android.wm.shell.R.dimen.desktop_mode_fullscreen_from_desktop_height)
                : 2 * layout.stableInsets().top;
        // A thin, short Rect at the top of the screen.
        if (windowingMode == WINDOWING_MODE_FREEFORM) {
            int fromFreeformWidth = mContext.getResources().getDimensionPixelSize(
+3 −2
Original line number Diff line number Diff line
@@ -867,8 +867,9 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                }
                if (mTransitionDragActive) {
                    // Do not create an indicator at all if we're not past transition height.
                    if (ev.getRawY() < mContext.getResources().getDimensionPixelSize(com.android
                            .wm.shell.R.dimen.desktop_mode_fullscreen_from_desktop_height)
                    DisplayLayout layout = mDisplayController
                            .getDisplayLayout(relevantDecor.mTaskInfo.displayId);
                    if (ev.getRawY() < 2 * layout.stableInsets().top
                            && mMoveToDesktopAnimator == null) {
                        return;
                    }
+3 −3
Original line number Diff line number Diff line
@@ -68,17 +68,17 @@ class DesktopModeVisualIndicatorTest : ShellTestCase() {
        )
        var testRegion = visualIndicator.calculateFullscreenRegion(displayLayout,
            WINDOWING_MODE_FULLSCREEN, CAPTION_HEIGHT)
        assertThat(testRegion.bounds).isEqualTo(Rect(0, -50, 2400, transitionHeight))
        assertThat(testRegion.bounds).isEqualTo(Rect(0, -50, 2400, 2 * STABLE_INSETS.top))
        testRegion = visualIndicator.calculateFullscreenRegion(displayLayout,
            WINDOWING_MODE_FREEFORM, CAPTION_HEIGHT)
        assertThat(testRegion.bounds).isEqualTo(Rect(
            DISPLAY_BOUNDS.width() / 2 - fromFreeformWidth / 2,
            -50,
            DISPLAY_BOUNDS.width() / 2 + fromFreeformWidth / 2,
            2 * STABLE_INSETS.top))
            transitionHeight))
        testRegion = visualIndicator.calculateFullscreenRegion(displayLayout,
            WINDOWING_MODE_MULTI_WINDOW, CAPTION_HEIGHT)
        assertThat(testRegion.bounds).isEqualTo(Rect(0, -50, 2400, transitionHeight))
        assertThat(testRegion.bounds).isEqualTo(Rect(0, -50, 2400, 2 * STABLE_INSETS.top))
    }

    @Test