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

Commit 5eb4a1e9 authored by Tony Wickham's avatar Tony Wickham
Browse files

Slightly scale down adjacent recent pages

Bug: 70179222
Change-Id: Iad0c6f87af633dab4d5c7b67da73bd8027c37c5d
parent 81bd3f57
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.widget.FrameLayout;
import android.widget.ImageView;

import com.android.launcher3.BaseDraggingActivity;
import com.android.launcher3.Launcher;
import com.android.launcher3.R;
import com.android.quickstep.views.RecentsView.PageCallbacks;
import com.android.quickstep.views.RecentsView.ScrollState;
@@ -55,6 +54,11 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
     */
    private static final float MAX_PAGE_SCRIM_ALPHA = 0.4f;

    /**
     * How much to scale down pages near the edge of the screen.
     */
    private static final float EDGE_SCALE_DOWN_FACTOR = 0.03f;

    private static final long SCALE_ICON_DURATION = 120;

    private Task mTask;
@@ -166,6 +170,10 @@ public class TaskView extends FrameLayout implements TaskCallbacks, PageCallback
                CURVE_INTERPOLATOR.getInterpolation(scrollState.linearInterpolation);

        mSnapshotView.setDimAlpha(1 - curveInterpolation * MAX_PAGE_SCRIM_ALPHA);

        float scale = 1 - curveInterpolation * EDGE_SCALE_DOWN_FACTOR;
        setScaleX(scale);
        setScaleY(scale);
    }

    private static final class TaskOutlineProvider extends ViewOutlineProvider {