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

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

Merge "Fix some MW visual issues" into ub-launcher3-qt-dev

parents 32d475bc 8d86cf0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
        Rect targetRect = new Rect();
        mHelper.getSwipeUpDestinationAndLength(mActivity.getDeviceProfile(), mActivity, targetRect);
        clipHelper.updateTargetRect(targetRect);
        clipHelper.prepareAnimation(false /* isOpening */);
        clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */);

        ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams()
                .setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView));
+6 −1
Original line number Diff line number Diff line
@@ -26,8 +26,11 @@ import android.content.ComponentName;
import android.graphics.RectF;
import android.view.View;

import com.android.launcher3.BaseActivity;
import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.Utilities;
import com.android.quickstep.util.ClipAnimationHelper;
import com.android.quickstep.util.MultiValueUpdateListener;
@@ -134,7 +137,9 @@ public final class TaskViewUtils {
            {
                inOutHelper.setTaskAlphaCallback((t, alpha) -> mTaskAlpha.value);

                inOutHelper.prepareAnimation(true /* isOpening */);
                inOutHelper.prepareAnimation(
                        BaseActivity.fromContext(v.getContext()).getDeviceProfile(),
                        true /* isOpening */);
                inOutHelper.fromTaskThumbnailView(v.getThumbnail(), (RecentsView) v.getParent(),
                        targetSet.apps.length == 0 ? null : targetSet.apps[0]);

+1 −1
Original line number Diff line number Diff line
@@ -730,7 +730,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
        if (runningTaskTarget != null) {
            mClipAnimationHelper.updateSource(overviewStackBounds, runningTaskTarget);
        }
        mClipAnimationHelper.prepareAnimation(false /* isOpening */);
        mClipAnimationHelper.prepareAnimation(dp, false /* isOpening */);
        initTransitionEndpoints(dp);

        mRecentsAnimationWrapper.setController(targetSet);
+12 −3
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ public class ClipAnimationHelper {
    private final RectF mClipRectF = new RectF();
    private final RectFEvaluator mRectFEvaluator = new RectFEvaluator();
    private final Matrix mTmpMatrix = new Matrix();
    private final Rect mTmpRect = new Rect();
    private final RectF mTmpRectF = new RectF();
    private final RectF mCurrentRectWithInsets = new RectF();
    // Corner radius of windows, in pixels
@@ -89,6 +90,8 @@ public class ClipAnimationHelper {
    private final float mTaskCornerRadius;
    // If windows can have real time rounded corners.
    private final boolean mSupportsRoundedCornersOnWindows;
    // Whether or not to actually use the rounded cornders on windows
    private boolean mUseRoundedCornersOnWindows;

    // Corner radius currently applied to transformed window.
    private float mCurrentCornerRadius;
@@ -103,6 +106,7 @@ public class ClipAnimationHelper {
        mWindowCornerRadius = getWindowCornerRadius(context.getResources());
        mSupportsRoundedCornersOnWindows = supportsRoundedCornersOnWindows(context.getResources());
        mTaskCornerRadius = TaskCornerRadius.get(context);
        mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows;
    }

    private void updateSourceStack(RemoteAnimationTargetCompat target) {
@@ -144,8 +148,9 @@ public class ClipAnimationHelper {
        mSourceRect.set(scaledTargetRect);
    }

    public void prepareAnimation(boolean isOpening) {
    public void prepareAnimation(DeviceProfile dp, boolean isOpening) {
        mBoostModeTargetLayers = isOpening ? MODE_OPENING : MODE_CLOSING;
        mUseRoundedCornersOnWindows = mSupportsRoundedCornersOnWindows && !dp.isMultiWindowMode;
    }

    public RectF applyTransform(RemoteAnimationTargetSet targetSet, TransformParams params) {
@@ -177,7 +182,9 @@ public class ClipAnimationHelper {
        for (int i = 0; i < targetSet.unfilteredApps.length; i++) {
            RemoteAnimationTargetCompat app = targetSet.unfilteredApps[i];
            mTmpMatrix.setTranslate(app.position.x, app.position.y);
            Rect crop = app.sourceContainerBounds;
            Rect crop = mTmpRect;
            crop.set(app.sourceContainerBounds);
            crop.offsetTo(0, 0);
            float alpha = 1f;
            int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers);
            float cornerRadius = 0f;
@@ -188,7 +195,9 @@ public class ClipAnimationHelper {
                    mTmpMatrix.postTranslate(app.position.x, app.position.y);
                    mClipRectF.roundOut(crop);
                    if (mSupportsRoundedCornersOnWindows) {
                        cornerRadius = Utilities.mapRange(params.progress, mWindowCornerRadius,
                        float windowCornerRadius = mUseRoundedCornersOnWindows
                                ? mWindowCornerRadius : 0;
                        cornerRadius = Utilities.mapRange(params.progress, windowCornerRadius,
                                mTaskCornerRadius);
                        mCurrentCornerRadius = cornerRadius;
                    }