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

Commit d642b651 authored by Pat Manning's avatar Pat Manning Committed by Android (Google) Code Review
Browse files

Merge "Scale task rounded corners proportional to TaskView size." into sc-v2-dev

parents a1ef7b3c 8a6179bb
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -794,7 +794,7 @@ public class TaskView extends FrameLayout implements Reusable {
        mIconView.setRotation(orientationHandler.getDegreesRotated());
        snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx;
        mSnapshotView.setLayoutParams(snapshotParams);
        getThumbnail().getTaskOverlay().updateOrientationState(orientationState);
        mSnapshotView.getTaskOverlay().updateOrientationState(orientationState);
    }

    private void setIconAndDimTransitionProgress(float progress, boolean invert) {
@@ -958,6 +958,7 @@ public class TaskView extends FrameLayout implements Reusable {

    private void setNonGridScale(float nonGridScale) {
        mNonGridScale = nonGridScale;
        updateCornerRadius();
        applyScale();
    }

@@ -1296,18 +1297,21 @@ public class TaskView extends FrameLayout implements Reusable {
        progress = Utilities.boundToRange(progress, 0, 1);
        mFullscreenProgress = progress;
        mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE);
        getThumbnail().getTaskOverlay().setFullscreenProgress(progress);
        mSnapshotView.getTaskOverlay().setFullscreenProgress(progress);

        TaskThumbnailView thumbnail = getThumbnail();
        updateCurrentFullscreenParams(thumbnail.getPreviewPositionHelper());
        updateCornerRadius();

        thumbnail.setFullscreenParams(mCurrentFullscreenParams);
        mSnapshotView.setFullscreenParams(mCurrentFullscreenParams);
        mOutlineProvider.updateParams(
                mCurrentFullscreenParams,
                mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx);
        invalidateOutline();
    }

    private void updateCornerRadius() {
        updateCurrentFullscreenParams(mSnapshotView.getPreviewPositionHelper());
    }

    void updateCurrentFullscreenParams(PreviewPositionHelper previewPositionHelper) {
        if (getRecentsView() == null) {
            return;
@@ -1315,7 +1319,7 @@ public class TaskView extends FrameLayout implements Reusable {
        mCurrentFullscreenParams.setProgress(
                mFullscreenProgress,
                getRecentsView().getScaleX(),
                getScaleX(),
                mNonGridScale,
                getWidth(), mActivity.getDeviceProfile(),
                previewPositionHelper);
    }