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

Commit 7ad57a18 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Correct β­• β›Ά πŸ•³οΈ πŸ‘ŠπŸ‘ŠπŸ‘ŠπŸ‘ŠπŸ‘ŠπŸ‘Š"

parents f1bb3a4d aa1b1c9a
Loading
Loading
Loading
Loading
+4 βˆ’2
Original line number Diff line number Diff line
@@ -549,7 +549,8 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {
                public void finish() { }

                @Override
                public void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect) { }
                public void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect,
                        float cornerRadius) { }
            };
        }

@@ -627,7 +628,8 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> {

        void finish();

        void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect);
        void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect,
                float cornerRadius);
    }

    interface ActivityInitListener {
+2 βˆ’1
Original line number Diff line number Diff line
@@ -601,7 +601,8 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
    private void updateFinalShiftUi() {
        if (mRecentsAnimationWrapper.getController() != null && mLayoutListener != null) {
            mLayoutListener.update(mCurrentShift.value > 1, mUiLongSwipeMode,
                    mClipAnimationHelper.getCurrentRectWithInsets());
                    mClipAnimationHelper.getCurrentRectWithInsets(),
                    mClipAnimationHelper.getCurrentCornerRadius());
        }

        final boolean passed = mCurrentShift.value >= MIN_PROGRESS_FOR_OVERVIEW;
+14 βˆ’3
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ public class ClipAnimationHelper {
    // Corner radius of windows when they're in overview mode.
    private final float mTaskCornerRadius;

    // Corner radius currently applied to transformed window.
    private float mCurrentCornerRadius;
    private float mTargetScale = 1f;
    private float mOffsetScale = 1f;
    private Interpolator mInterpolator = LINEAR;
@@ -179,14 +181,15 @@ public class ClipAnimationHelper {
            float alpha = 1f;
            int layer;
            float cornerRadius = 0f;
            float scale = currentRect.width() / crop.width();
            if (app.mode == targetSet.targetMode) {
                if (app.activityType != RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME) {
                    mTmpMatrix.setRectToRect(mSourceRect, currentRect, ScaleToFit.FILL);
                    mTmpMatrix.postTranslate(app.position.x, app.position.y);
                    mClipRectF.roundOut(crop);
                    float scale = crop.width() / currentRect.width();
                    cornerRadius = Utilities.mapRange(progress, mWindowCornerRadius,
                            mTaskCornerRadius * scale);
                            mTaskCornerRadius);
                    mCurrentCornerRadius = cornerRadius;
                }

                if (app.isNotInRecents
@@ -200,7 +203,11 @@ public class ClipAnimationHelper {
                crop = null;
                layer = Integer.MAX_VALUE;
            }
            params[i] = new SurfaceParams(app.leash, alpha, mTmpMatrix, crop, layer, cornerRadius);

            // Since radius is in Surface space, but we draw the rounded corners in screen space, we
            // have to undo the scale.
            params[i] = new SurfaceParams(app.leash, alpha, mTmpMatrix, crop, layer,
                    cornerRadius / scale);
        }
        applyParams(syncTransactionApplier, params);
        return currentRect;
@@ -339,4 +346,8 @@ public class ClipAnimationHelper {
    public RectF getSourceRect() {
        return mSourceRect;
    }

    public float getCurrentCornerRadius() {
        return mCurrentCornerRadius;
    }
}
+5 βˆ’2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public class LauncherLayoutListener extends AbstractFloatingView
    private final Paint mPaint = new Paint();
    private WindowTransformSwipeHandler mHandler;
    private RectF mCurrentRect;
    private float mCornerRadius;

    public LauncherLayoutListener(Launcher launcher) {
        super(launcher, null);
@@ -52,13 +53,15 @@ public class LauncherLayoutListener extends AbstractFloatingView
    }

    @Override
    public void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect) {
    public void update(boolean shouldFinish, boolean isLongSwipe, RectF currentRect,
            float cornerRadius) {
        if (shouldFinish) {
            finish();
            return;
        }

        mCurrentRect = currentRect;
        mCornerRadius = cornerRadius;

        setWillNotDraw(mCurrentRect == null || isLongSwipe);
        invalidate();
@@ -121,6 +124,6 @@ public class LauncherLayoutListener extends AbstractFloatingView

    @Override
    protected void onDraw(Canvas canvas) {
        canvas.drawRect(mCurrentRect, mPaint);
        canvas.drawRoundRect(mCurrentRect, mCornerRadius, mCornerRadius, mPaint);
    }
}