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

Commit d1d342b1 authored by Tony Wickham's avatar Tony Wickham
Browse files

Always update clip rect before applying surface params

Previously, we were only updating the clip rect when params.currentRect
== null, meaning the clip would be stale once the caller started
providing its own rect (e.g. when swiping to home).

Also fix some visual jumps when swiping home, all caused by running the
transform progress from 0 to 1 instead of starting at whatever the
progress was before ending the gesture, e.g.:
- When swiping to home without animating into an icon, the corner radius
  was set back to the window corner radius.
- Before this change, the clip didn't update throughout the animation,
  making the window slightly bigger than the floating icon view; after
  this change, the clip jumped to show the insets again before clipping
  back down during the home animation.

Bug: 149870691
Change-Id: Ie48f4b665a5bf3cbef76bdf7f043febe99fb84a0
parent badab61a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -428,6 +428,10 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
        // rounding at the end of the animation.
        float startRadius = mAppWindowAnimationHelper.getCurrentCornerRadius();
        float endRadius = startRect.width() / 6f;

        float startTransformProgress = mTransformParams.getProgress();
        float endTransformProgress = 1;

        // We want the window alpha to be 0 once this threshold is met, so that the
        // FolderIconView can be seen morphing into the icon shape.
        final float windowAlphaThreshold = isFloatingIconView ? 1f - SHAPE_PROGRESS_DURATION : 1f;
@@ -437,7 +441,8 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
            public void onUpdate(RectF currentRect, float progress) {
                homeAnim.setPlayFraction(progress);

                mTransformParams.setProgress(progress)
                mTransformParams.setProgress(
                        Utilities.mapRange(progress, startTransformProgress, endTransformProgress))
                        .setCurrentRect(currentRect)
                        .setTargetAlpha(getWindowAlpha(progress));
                if (isFloatingIconView) {
+3 −2
Original line number Diff line number Diff line
@@ -242,9 +242,10 @@ public class AppWindowAnimationHelper {
            Utilities.scaleRectFAboutCenter(mTmpRectF, params.mOffsetScale);
            mCurrentRect.set(mRectFEvaluator.evaluate(params.mProgress, mSourceRect, mTmpRectF));
            mCurrentRect.offset(params.mOffsetX, 0);
        }

        updateClipRect(params);
        }

        return mCurrentRect;
    }