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

Commit 225f5489 authored by Tony Huang's avatar Tony Huang Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE if draging again while animating" into tm-dev am: a876e7b2

parents ca005159 a876e7b2
Loading
Loading
Loading
Loading
+10 −5
Original line number Original line Diff line number Diff line
@@ -160,6 +160,15 @@ public class SplitDecorManager extends WindowlessWindowManager {
            mBounds.set(newBounds);
            mBounds.set(newBounds);
        }
        }


        final boolean show =
                newBounds.width() > mBounds.width() || newBounds.height() > mBounds.height();
        final boolean animate = show != mShown;
        if (animate && mFadeAnimator != null && mFadeAnimator.isRunning()) {
            // If we need to animate and animator still running, cancel it before we ensure both
            // background and icon surfaces are non null for next animation.
            mFadeAnimator.cancel();
        }

        if (mBackgroundLeash == null) {
        if (mBackgroundLeash == null) {
            mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
            mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
                    RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
                    RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
@@ -183,11 +192,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
                newBounds.width() / 2 - mIconSize / 2,
                newBounds.width() / 2 - mIconSize / 2,
                newBounds.height() / 2 - mIconSize / 2);
                newBounds.height() / 2 - mIconSize / 2);


        boolean show = newBounds.width() > mBounds.width() || newBounds.height() > mBounds.height();
        if (animate) {
        if (show != mShown) {
            if (mFadeAnimator != null && mFadeAnimator.isRunning()) {
                mFadeAnimator.cancel();
            }
            startFadeAnimation(show, false /* isResized */);
            startFadeAnimation(show, false /* isResized */);
            mShown = show;
            mShown = show;
        }
        }