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

Commit e525a357 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix multi-window enter animation

Stable insets are not calculated in the first pass, so fetch it
manually if needed to avoid a relayout.

Bug: 28705801
Change-Id: I8f9a3bab96b597a80963d7ebcc8b19454b3e45a6
parent f97a0f5c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1064,6 +1064,14 @@ public class DividerView extends FrameLayout implements OnTouchListener,
        int position = DockedDividerUtils.calculatePositionForBounds(event.initialRect,
                mDockSide, mDividerSize);
        mEntranceAnimationRunning = true;

        // Insets might not have been fetched yet, so fetch manually if needed.
        if (mStableInsets.isEmpty()) {
            SystemServicesProxy.getInstance(mContext).getStableInsets(mStableInsets);
            mSnapAlgorithm = null;
            initializeSnapAlgorithm();
        }

        resizeStack(position, mSnapAlgorithm.getMiddleTarget().position,
                mSnapAlgorithm.getMiddleTarget());
    }