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

Commit cbb625bc authored by Winson's avatar Winson
Browse files

Fixing app transition due to left-nav bar inset.

- Also center in available space regardless of which side the bar inset
  is on.

Bug: 29917174
Change-Id: If84dfb3bbff3c3d3de70473c74f5bfc5a8f32a59
parent 0f6c2bfe
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -609,7 +609,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
        stackLayout.setSystemInsets(systemInsets);
        stackLayout.setSystemInsets(systemInsets);
        if (stack != null) {
        if (stack != null) {
            stackLayout.getTaskStackBounds(displayRect, windowRect, systemInsets.top,
            stackLayout.getTaskStackBounds(displayRect, windowRect, systemInsets.top,
                    systemInsets.right, mTaskStackBounds);
                    systemInsets.left, systemInsets.right, mTaskStackBounds);
            stackLayout.reset();
            stackLayout.reset();
            stackLayout.initialize(displayRect, windowRect, mTaskStackBounds,
            stackLayout.initialize(displayRect, windowRect, mTaskStackBounds,
                    TaskStackLayoutAlgorithm.StackState.getStackStateForStack(stack));
                    TaskStackLayoutAlgorithm.StackState.getStackStateForStack(stack));
+2 −2
Original line number Original line Diff line number Diff line
@@ -511,8 +511,8 @@ public class TaskStack {
            int top = dockArea.bottom < 1f
            int top = dockArea.bottom < 1f
                    ? 0
                    ? 0
                    : insets.top;
                    : insets.top;
            layoutAlgorithm.getTaskStackBounds(displayRect, windowRectOut, top, insets.right,
            layoutAlgorithm.getTaskStackBounds(displayRect, windowRectOut, top, insets.left,
                    taskStackBounds);
                    insets.right, taskStackBounds);
            return taskStackBounds;
            return taskStackBounds;
        }
        }
    }
    }
+3 −3
Original line number Original line Diff line number Diff line
@@ -1058,9 +1058,9 @@ public class TaskStackLayoutAlgorithm {
     * top and right system insets (but not the bottom inset) and left/right paddings, but _not_
     * top and right system insets (but not the bottom inset) and left/right paddings, but _not_
     * the top/bottom padding or insets.
     * the top/bottom padding or insets.
     */
     */
    public void getTaskStackBounds(Rect displayRect, Rect windowRect, int topInset, int rightInset,
    public void getTaskStackBounds(Rect displayRect, Rect windowRect, int topInset, int leftInset,
            Rect taskStackBounds) {
            int rightInset, Rect taskStackBounds) {
        taskStackBounds.set(windowRect.left, windowRect.top + topInset,
        taskStackBounds.set(windowRect.left + leftInset, windowRect.top + topInset,
                windowRect.right - rightInset, windowRect.bottom);
                windowRect.right - rightInset, windowRect.bottom);


        // Ensure that the new width is at most the smaller display edge size
        // Ensure that the new width is at most the smaller display edge size
+2 −1
Original line number Original line Diff line number Diff line
@@ -1191,7 +1191,8 @@ public class TaskStackView extends FrameLayout implements TaskStack.TaskStackCal
        // bounds have changed.  This is because we may get spurious measures while dragging where
        // bounds have changed.  This is because we may get spurious measures while dragging where
        // our current stack bounds reflect the target drop region.
        // our current stack bounds reflect the target drop region.
        mLayoutAlgorithm.getTaskStackBounds(mDisplayRect, new Rect(0, 0, width, height),
        mLayoutAlgorithm.getTaskStackBounds(mDisplayRect, new Rect(0, 0, width, height),
                mLayoutAlgorithm.mSystemInsets.top, mLayoutAlgorithm.mSystemInsets.right, mTmpRect);
                mLayoutAlgorithm.mSystemInsets.top, mLayoutAlgorithm.mSystemInsets.left,
                mLayoutAlgorithm.mSystemInsets.right, mTmpRect);
        if (!mTmpRect.equals(mStableStackBounds)) {
        if (!mTmpRect.equals(mStableStackBounds)) {
            mStableStackBounds.set(mTmpRect);
            mStableStackBounds.set(mTmpRect);
            mStackBounds.set(mTmpRect);
            mStackBounds.set(mTmpRect);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1057,7 +1057,7 @@ public class AppTransition implements Dump {
        final float thumbWidth = thumbWidthI > 0 ? thumbWidthI : 1;
        final float thumbWidth = thumbWidthI > 0 ? thumbWidthI : 1;
        final int thumbHeightI = mTmpRect.height();
        final int thumbHeightI = mTmpRect.height();
        final float thumbHeight = thumbHeightI > 0 ? thumbHeightI : 1;
        final float thumbHeight = thumbHeightI > 0 ? thumbHeightI : 1;
        final int thumbStartX = mTmpRect.left - containingFrame.left;
        final int thumbStartX = mTmpRect.left - containingFrame.left - contentInsets.left;
        final int thumbStartY = mTmpRect.top - containingFrame.top;
        final int thumbStartY = mTmpRect.top - containingFrame.top;


        switch (thumbTransitState) {
        switch (thumbTransitState) {