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

Commit 3776268f authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Use stable rect to determine if we should adjust for IME in split-screen"

parents 74c10e2b db506191
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1766,8 +1766,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        updateBounds();
    }

    void getContentRect(Rect out) {
        out.set(mDisplayFrames.mContent);
    void getStableRect(Rect out) {
        out.set(mDisplayFrames.mStable);
    }

    TaskStack createStack(int stackId, boolean onTop, StackWindowController controller) {
+6 −6
Original line number Diff line number Diff line
@@ -1114,12 +1114,12 @@ public class TaskStack extends WindowContainer<Task> implements
            return false;
        }

        final Rect displayContentRect = mTmpRect;
        final Rect displayStableRect = mTmpRect;
        final Rect contentBounds = mTmpRect2;

        // Calculate the content bounds excluding the area occupied by IME
        getDisplayContent().getContentRect(displayContentRect);
        contentBounds.set(displayContentRect);
        getDisplayContent().getStableRect(displayStableRect);
        contentBounds.set(displayStableRect);
        int imeTop = Math.max(imeWin.getFrameLw().top, contentBounds.top);

        imeTop += imeWin.getGivenContentInsetsLw().top;
@@ -1127,7 +1127,7 @@ public class TaskStack extends WindowContainer<Task> implements
            contentBounds.bottom = imeTop;
        }

        final int yOffset = displayContentRect.bottom - contentBounds.bottom;
        final int yOffset = displayStableRect.bottom - contentBounds.bottom;

        final int dividerWidth =
                getDisplayContent().mDividerControllerLocked.getContentWidth();
@@ -1139,7 +1139,7 @@ public class TaskStack extends WindowContainer<Task> implements
            // occluded by IME. We shift its bottom up by the height of the IME, but
            // leaves at least 30% of the top stack visible.
            final int minTopStackBottom =
                    getMinTopStackBottom(displayContentRect, getRawBounds().bottom);
                    getMinTopStackBottom(displayStableRect, getRawBounds().bottom);
            final int bottom = Math.max(
                    getRawBounds().bottom - yOffset + dividerWidth - dividerWidthInactive,
                    minTopStackBottom);
@@ -1159,7 +1159,7 @@ public class TaskStack extends WindowContainer<Task> implements
            final int topBeforeImeAdjust =
                    getRawBounds().top - dividerWidth + dividerWidthInactive;
            final int minTopStackBottom =
                    getMinTopStackBottom(displayContentRect,
                    getMinTopStackBottom(displayStableRect,
                            getRawBounds().top - dividerWidth);
            final int top = Math.max(
                    getRawBounds().top - yOffset, minTopStackBottom + dividerWidthInactive);