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

Commit b27496a6 authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "Swap freeform vs non-freeform TO_FULLSCREEN heights." into main

parents 50ed75e6 99ec2739
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