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

Commit 658b07f3 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Make WindowState mUnderStatusBar reflect position."

parents 4ea7b1c3 d76dcdcd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ class DisplayContent {
    boolean setStackBoxSize(Rect contentRect) {
        boolean change = false;
        for (int stackBoxNdx = mStackBoxes.size() - 1; stackBoxNdx >= 0; --stackBoxNdx) {
            change |= mStackBoxes.get(stackBoxNdx).setStackBoxSizes(contentRect);
            change |= mStackBoxes.get(stackBoxNdx).setStackBoxSizes(contentRect, true);
        }
        return change;
    }
+16 −8
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ public class StackBox {
    /** Dirty flag. Something inside this or some descendant of this has changed. */
    boolean layoutNeeded;

    /** True if this StackBox sits below the Status Bar. */
    boolean mUnderStatusBar;

    /** Used to keep from reallocating a temporary Rect for propagating bounds to child boxes */
    Rect mTmpRect = new Rect();

@@ -286,14 +289,19 @@ public class StackBox {

    /** If this is a terminal StackBox (contains a TaskStack) set the bounds.
     * @param bounds The rectangle to set the bounds to.
     * @param underStatusBar True if the StackBox is directly below the Status Bar.
     * @return True if the bounds changed, false otherwise. */
    boolean setStackBoxSizes(Rect bounds) {
        boolean change;
    boolean setStackBoxSizes(Rect bounds, boolean underStatusBar) {
        boolean change = false;
        if (mUnderStatusBar != underStatusBar) {
            change = true;
            mUnderStatusBar = underStatusBar;
        }
        if (mStack != null) {
            change = !mBounds.equals(bounds);
            change |= !mBounds.equals(bounds);
            if (change) {
                mBounds.set(bounds);
                mStack.setBounds(bounds);
                mStack.setBounds(bounds, underStatusBar);
            }
        } else {
            mTmpRect.set(bounds);
@@ -301,18 +309,18 @@ public class StackBox {
                final int height = bounds.height();
                int firstHeight = (int)(height * mWeight);
                mTmpRect.bottom = bounds.top + firstHeight;
                change = mFirst.setStackBoxSizes(mTmpRect);
                change |= mFirst.setStackBoxSizes(mTmpRect, underStatusBar);
                mTmpRect.top = mTmpRect.bottom;
                mTmpRect.bottom = bounds.top + height;
                change |= mSecond.setStackBoxSizes(mTmpRect);
                change |= mSecond.setStackBoxSizes(mTmpRect, false);
            } else {
                final int width = bounds.width();
                int firstWidth = (int)(width * mWeight);
                mTmpRect.right = bounds.left + firstWidth;
                change = mFirst.setStackBoxSizes(mTmpRect);
                change |= mFirst.setStackBoxSizes(mTmpRect, underStatusBar);
                mTmpRect.left = mTmpRect.right;
                mTmpRect.right = bounds.left + width;
                change |= mSecond.setStackBoxSizes(mTmpRect);
                change |= mSecond.setStackBoxSizes(mTmpRect, underStatusBar);
            }
        }
        return change;
+2 −1
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ public class TaskStack {
        }
    }

    void setBounds(Rect bounds) {
    void setBounds(Rect bounds, boolean underStatusBar) {
        mDimLayer.setBounds(bounds);
        mAnimationBackgroundSurface.setBounds(bounds);

@@ -236,6 +236,7 @@ public class TaskStack {
                    if (!resizingWindows.contains(win)) {
                        resizingWindows.add(win);
                    }
                    win.mUnderStatusBar = underStatusBar;
                }
            }
        }