diff --git a/quickstep/src/com/android/quickstep/util/WorkspaceUnlockAnim.java b/quickstep/src/com/android/quickstep/util/WorkspaceUnlockAnim.java
deleted file mode 100644
index aa3f0d7..0000000
--- a/quickstep/src/com/android/quickstep/util/WorkspaceUnlockAnim.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.quickstep.util;
-
-import com.android.launcher3.Launcher;
-import com.android.launcher3.Utilities;
-
-/**
- * Animation to animate in a workspace during the unlock transition.
- */
-// TODO(b/219444608): use SCALE_PROPERTY_FACTORY once the scale is reset to 1.0 after unlocking.
-public class WorkspaceUnlockAnim {
-    /** Scale for the workspace icons at the beginning of the animation. */
-    private static final float START_SCALE = 0.9f;
-
-    /**
-     * Starting translation Y values for the animation. We use a larger value if we're animating in
-     * from a swipe, since there is more perceived upward movement when we unlock from a swipe.
-     */
-    private static final int START_TRANSLATION_DP = 15;
-    private static final int START_TRANSLATION_SWIPE_DP = 60;
-
-    private Launcher mLauncher;
-    private float mUnlockAmount = 0f;
-
-    public WorkspaceUnlockAnim(Launcher launcher) {
-        mLauncher = launcher;
-    }
-
-    /**
-     * Called when we're about to make the Launcher window visible and play the unlock animation.
-     *
-     * This is a blocking call so that System UI knows it's safe to show the Launcher window without
-     * causing the Launcher contents to flicker on screen. Do not do anything expensive here.
-     */
-    public void prepareForUnlock() {
-        mLauncher.getWorkspace().setAlpha(0f);
-        mLauncher.getHotseat().setAlpha(0f);
-
-        mUnlockAmount = 0f;
-    }
-
-    public void setUnlockAmount(float amount, boolean fromSwipe) {
-        mUnlockAmount = amount;
-
-        final float amountInverse = 1f - amount;
-        final float scale = START_SCALE + (1f - START_SCALE) * amount;
-
-        mLauncher.getWorkspace().setScaleX(scale);
-        mLauncher.getWorkspace().setScaleY(scale);
-        mLauncher.getWorkspace().setAlpha(amount);
-        mLauncher.getWorkspace().setPivotToScaleWithSelf(mLauncher.getHotseat());
-
-        mLauncher.getHotseat().setScaleX(scale);
-        mLauncher.getHotseat().setScaleY(scale);
-        mLauncher.getHotseat().setAlpha(amount);
-
-        if (fromSwipe) {
-            mLauncher.getWorkspace().setTranslationY(
-                    Utilities.dpToPx(START_TRANSLATION_SWIPE_DP) * amountInverse);
-            mLauncher.getHotseat().setTranslationY(
-                    Utilities.dpToPx(START_TRANSLATION_SWIPE_DP) * amountInverse);
-        } else {
-            mLauncher.getWorkspace().setTranslationY(
-                    Utilities.dpToPx(START_TRANSLATION_DP) * amountInverse);
-            mLauncher.getHotseat().setTranslationY(
-                    Utilities.dpToPx(START_TRANSLATION_DP) * amountInverse);
-        }
-    }
-}
diff --git a/src/com/android/launcher3/anim/Interpolators.java b/src/com/android/launcher3/anim/Interpolators.java
index 9c12abd..3fe1082 100644
--- a/src/com/android/launcher3/anim/Interpolators.java
+++ b/src/com/android/launcher3/anim/Interpolators.java
@@ -47,6 +47,13 @@
     public static final Interpolator DEACCEL_2_5 = new DecelerateInterpolator(2.5f);
     public static final Interpolator DEACCEL_3 = new DecelerateInterpolator(3f);
 
+    /**
+     * The decelerating emphasized interpolator. Used for hero / emphasized movement of content that
+     * is appearing e.g. when coming from off screen
+     */
+    public static final Interpolator EMPHASIZED_DECELERATE = new PathInterpolator(
+            0.05f, 0.7f, 0.1f, 1f);
+
     public static final Interpolator ACCEL_DEACCEL = new AccelerateDecelerateInterpolator();
 
     public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f);
@@ -162,8 +169,9 @@
     }
 
     /**
-     * Runs the given interpolator such that the entire progress is set between the given bounds.
-     * That is, we set the interpolation to 0 until lowerBound and reach 1 by upperBound.
+     * Returns a function that runs the given interpolator such that the entire progress is set
+     * between the given bounds. That is, we set the interpolation to 0 until lowerBound and reach
+     * 1 by upperBound.
      */
     public static Interpolator clampToProgress(Interpolator interpolator, float lowerBound,
             float upperBound) {
@@ -172,18 +180,30 @@
                     String.format("upperBound (%f) must be greater than lowerBound (%f)",
                             upperBound, lowerBound));
         }
-        return t -> {
-            if (t == lowerBound && t == upperBound) {
-                return t == 0f ? 0 : 1;
-            }
-            if (t < lowerBound) {
-                return 0;
-            }
-            if (t > upperBound) {
-                return 1;
-            }
-            return interpolator.getInterpolation((t - lowerBound) / (upperBound - lowerBound));
-        };
+        return t -> clampToProgress(t, lowerBound, upperBound);
+    }
+
+    /**
+     * Returns the progress value's progress between the lower and upper bounds. That is, the
+     * progress will be 0f from 0f to lowerBound, and reach 1f by upperBound.
+     */
+    public static float clampToProgress(float progress, float lowerBound, float upperBound) {
+        if (upperBound < lowerBound) {
+            throw new IllegalArgumentException(
+                    String.format("upperBound (%f) must be greater than lowerBound (%f)",
+                            upperBound, lowerBound));
+        }
+
+        if (progress == lowerBound && progress == upperBound) {
+            return progress == 0f ? 0 : 1;
+        }
+        if (progress < lowerBound) {
+            return 0;
+        }
+        if (progress > upperBound) {
+            return 1;
+        }
+        return (progress - lowerBound) / (upperBound - lowerBound);
     }
 
     /**
