diff --git a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
index a11625a..da85990 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
@@ -15,6 +15,7 @@
  */
 package com.android.launcher3.uioverrides;
 
+import com.android.launcher3.DeviceProfile;
 import com.android.launcher3.Launcher;
 import com.android.quickstep.QuickScrubController;
 import com.android.quickstep.views.RecentsView;
@@ -45,6 +46,15 @@
 
     @Override
     public float[] getOverviewScaleAndTranslationYFactor(Launcher launcher) {
-        return new float[] {1f, 0.5f};
+        return new float[] {getOverviewScale(launcher.getDeviceProfile()), 0.5f};
+    }
+
+    public static float getOverviewScale(DeviceProfile dp) {
+        if (dp.isMultiWindowMode || dp.isVerticalBarLayout()) {
+            return 1f;
+        }
+
+        // TODO: Calculate it dynamically based on available space
+        return 1.3f;
     }
 }
diff --git a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
index e43b24a..e3aabd6 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/RecentsViewStateController.java
@@ -15,6 +15,7 @@
  */
 package com.android.launcher3.uioverrides;
 
+import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
 import static com.android.launcher3.LauncherState.FAST_OVERVIEW;
 import static com.android.launcher3.LauncherState.OVERVIEW;
 import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_FADE;
@@ -24,7 +25,6 @@
 import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_START_INTERPOLATOR;
 import static com.android.quickstep.QuickScrubController.QUICK_SCRUB_TRANSLATION_Y_FACTOR;
 import static com.android.quickstep.views.LauncherRecentsView.TRANSLATION_Y_FACTOR;
-import static com.android.quickstep.views.RecentsView.ADJACENT_SCALE;
 import static com.android.quickstep.views.RecentsViewContainer.CONTENT_ALPHA;
 
 import android.animation.ValueAnimator;
@@ -59,7 +59,7 @@
     public void setState(LauncherState state) {
         mRecentsViewContainer.setContentAlpha(state.overviewUi ? 1 : 0);
         float[] scaleTranslationYFactor = state.getOverviewScaleAndTranslationYFactor(mLauncher);
-        mRecentsView.setAdjacentScale(scaleTranslationYFactor[0]);
+        SCALE_PROPERTY.set(mRecentsView, scaleTranslationYFactor[0]);
         mRecentsView.setTranslationYFactor(scaleTranslationYFactor[1]);
         if (state.overviewUi) {
             mRecentsView.updateEmptyMessage();
@@ -77,7 +77,7 @@
         PropertySetter setter = config.getPropertySetter(builder);
         float[] scaleTranslationYFactor = toState.getOverviewScaleAndTranslationYFactor(mLauncher);
         Interpolator scaleInterpolator = builder.getInterpolator(ANIM_OVERVIEW_SCALE, LINEAR);
-        setter.setFloat(mRecentsView, ADJACENT_SCALE, scaleTranslationYFactor[0], scaleInterpolator);
+        setter.setFloat(mRecentsView, SCALE_PROPERTY, scaleTranslationYFactor[0], scaleInterpolator);
         Interpolator transYInterpolator = scaleInterpolator;
         if (mLauncher.getStateManager().getState() == OVERVIEW && toState == FAST_OVERVIEW) {
             transYInterpolator = Interpolators.clampToProgress(QUICK_SCRUB_START_INTERPOLATOR, 0,
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index 76820b6..d0c7b21 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -19,6 +19,7 @@
 import static android.view.View.VISIBLE;
 import static com.android.launcher3.AbstractFloatingView.TYPE_ALL;
 import static com.android.launcher3.AbstractFloatingView.TYPE_HIDE_BACK_BUTTON;
+import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY;
 import static com.android.launcher3.LauncherState.ALL_APPS;
 import static com.android.launcher3.LauncherState.NORMAL;
 import static com.android.launcher3.LauncherState.OVERVIEW;
@@ -207,7 +208,7 @@
     public static void prepareToShowOverview(Launcher launcher) {
         RecentsView overview = launcher.getOverviewPanel();
         if (overview.getVisibility() != VISIBLE || overview.getContentAlpha() == 0) {
-            overview.setAdjacentScale(1.33f);
+            SCALE_PROPERTY.set(overview, 1.33f);
         }
     }
 
diff --git a/quickstep/src/com/android/quickstep/ActivityControlHelper.java b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
index ae0affe..d47fec5 100644
--- a/quickstep/src/com/android/quickstep/ActivityControlHelper.java
+++ b/quickstep/src/com/android/quickstep/ActivityControlHelper.java
@@ -20,6 +20,8 @@
 import static com.android.launcher3.LauncherState.OVERVIEW;
 import static com.android.launcher3.allapps.AllAppsTransitionController.ALL_APPS_PROGRESS;
 import static com.android.launcher3.anim.Interpolators.LINEAR;
+import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL;
+import static com.android.quickstep.TouchConsumer.INTERACTION_QUICK_SCRUB;
 import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_BACK;
 import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_ROTATION;
 
@@ -48,9 +50,12 @@
 import com.android.launcher3.allapps.DiscoveryBounce;
 import com.android.launcher3.anim.AnimatorPlaybackController;
 import com.android.launcher3.dragndrop.DragLayer;
+import com.android.launcher3.uioverrides.FastOverviewState;
 import com.android.launcher3.userevent.nano.LauncherLogProto;
 import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
+import com.android.quickstep.TouchConsumer.InteractionType;
 import com.android.quickstep.util.LayoutUtils;
+import com.android.quickstep.util.TransformedRect;
 import com.android.quickstep.util.RemoteAnimationProvider;
 import com.android.quickstep.util.RemoteAnimationTargetSet;
 import com.android.quickstep.views.LauncherLayoutListener;
@@ -83,7 +88,8 @@
 
     void onTransitionCancelled(T activity, boolean activityVisible);
 
-    int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect);
+    int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+            @InteractionType int interactionType, TransformedRect outRect);
 
     void onSwipeUpComplete(T activity);
 
@@ -157,14 +163,18 @@
         }
 
         @Override
-        public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) {
-            LayoutUtils.calculateLauncherTaskSize(context, dp, outRect);
+        public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+                @InteractionType int interactionType, TransformedRect outRect) {
+            LayoutUtils.calculateLauncherTaskSize(context, dp, outRect.rect);
+            if (interactionType == INTERACTION_QUICK_SCRUB) {
+                outRect.scale = FastOverviewState.getOverviewScale(dp);
+            }
             if (dp.isVerticalBarLayout()) {
                 Rect targetInsets = dp.getInsets();
                 int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
                 return dp.hotseatBarSizePx + dp.hotseatBarSidePaddingPx + hotseatInset;
             } else {
-                return dp.heightPx - outRect.bottom;
+                return dp.heightPx - outRect.rect.bottom;
             }
         }
 
@@ -204,9 +214,10 @@
 
             return new AnimationFactory() {
                 @Override
-                public void createActivityController(long transitionLength) {
+                public void createActivityController(long transitionLength,
+                        @InteractionType int interactionType) {
                     createActivityControllerInternal(activity, activityVisible, startState,
-                            transitionLength, callback);
+                            transitionLength, interactionType, callback);
                 }
 
                 @Override
@@ -218,13 +229,16 @@
 
         private void createActivityControllerInternal(Launcher activity, boolean wasVisible,
                 LauncherState startState, long transitionLength,
+                @InteractionType int interactionType,
                 Consumer<AnimatorPlaybackController> callback) {
+            LauncherState endState = interactionType == INTERACTION_QUICK_SCRUB
+                    ? FAST_OVERVIEW : OVERVIEW;
             if (wasVisible) {
                 DeviceProfile dp = activity.getDeviceProfile();
                 long accuracy = 2 * Math.max(dp.widthPx, dp.heightPx);
                 activity.getStateManager().goToState(startState, false);
                 callback.accept(activity.getStateManager()
-                        .createAnimationToNewWorkspace(OVERVIEW, accuracy));
+                        .createAnimationToNewWorkspace(endState, accuracy));
                 return;
             }
 
@@ -238,7 +252,7 @@
             float scrollRange = Math.max(controller.getShiftRange(), 1);
             float progressDelta = (transitionLength / scrollRange);
 
-            float endProgress = OVERVIEW.getVerticalProgress(activity);
+            float endProgress = endState.getVerticalProgress(activity);
             float startProgress = endProgress + progressDelta;
             ObjectAnimator shiftAnim = ObjectAnimator.ofFloat(
                     controller, ALL_APPS_PROGRESS, startProgress, endProgress);
@@ -381,14 +395,15 @@
         }
 
         @Override
-        public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect) {
-            LayoutUtils.calculateFallbackTaskSize(context, dp, outRect);
+        public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context,
+                @InteractionType int interactionType, TransformedRect outRect) {
+            LayoutUtils.calculateFallbackTaskSize(context, dp, outRect.rect);
             if (dp.isVerticalBarLayout()) {
                 Rect targetInsets = dp.getInsets();
                 int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right;
                 return dp.hotseatBarSizePx + dp.hotseatBarSidePaddingPx + hotseatInset;
             } else {
-                return dp.heightPx - outRect.bottom;
+                return dp.heightPx - outRect.rect.bottom;
             }
         }
 
@@ -401,7 +416,7 @@
         public AnimationFactory prepareRecentsUI(RecentsActivity activity, boolean activityVisible,
                 Consumer<AnimatorPlaybackController> callback) {
             if (activityVisible) {
-                return (transitionLength) -> { };
+                return (transitionLength, interactionType) -> { };
             }
 
             RecentsViewContainer rv = activity.getOverviewPanelContainer();
@@ -418,11 +433,12 @@
                         rv.setContentAlpha(1);
                     }
                     createActivityController(getSwipeUpDestinationAndLength(
-                            activity.getDeviceProfile(), activity, new Rect()));
+                            activity.getDeviceProfile(), activity, INTERACTION_NORMAL,
+                            new TransformedRect()), INTERACTION_NORMAL);
                 }
 
                 @Override
-                public void createActivityController(long transitionLength) {
+                public void createActivityController(long transitionLength, int interactionType) {
                     if (!isAnimatingHome) {
                         return;
                     }
@@ -543,7 +559,7 @@
 
         default void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) { }
 
-        void createActivityController(long transitionLength);
+        void createActivityController(long transitionLength, @InteractionType int interactionType);
 
         default void onTransitionCancelled() { }
     }
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index 23738fb..a2aa4b9 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -326,10 +326,10 @@
             mPassedInitialSlop = true;
         }
 
-        notifyGestureStarted();
         if (mInteractionHandler != null) {
             mInteractionHandler.updateInteractionType(interactionType);
         }
+        notifyGestureStarted();
     }
 
     @Override
diff --git a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
index 7b29323..41a4550 100644
--- a/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
+++ b/quickstep/src/com/android/quickstep/OverviewCommandHelper.java
@@ -21,6 +21,7 @@
 
 import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
 import static com.android.launcher3.anim.Interpolators.TOUCH_RESPONSE_INTERPOLATOR;
+import static com.android.quickstep.TouchConsumer.INTERACTION_NORMAL;
 import static com.android.systemui.shared.system.ActivityManagerWrapper
         .CLOSE_SYSTEM_WINDOWS_REASON_RECENTS;
 import static com.android.systemui.shared.system.PackageManagerWrapper
@@ -59,6 +60,7 @@
 import com.android.quickstep.ActivityControlHelper.FallbackActivityControllerHelper;
 import com.android.quickstep.ActivityControlHelper.LauncherActivityControllerHelper;
 import com.android.quickstep.util.ClipAnimationHelper;
+import com.android.quickstep.util.TransformedRect;
 import com.android.quickstep.util.RemoteAnimationTargetSet;
 import com.android.quickstep.views.RecentsView;
 import com.android.systemui.shared.system.ActivityManagerWrapper;
@@ -282,7 +284,7 @@
                 });
             factory.onRemoteAnimationReceived(null);
             if (wasVisible) {
-                factory.createActivityController(RECENTS_LAUNCH_DURATION);
+                factory.createActivityController(RECENTS_LAUNCH_DURATION, INTERACTION_NORMAL);
             }
             mActivity = activity;
             mRecentsView = mActivity.getOverviewPanel();
@@ -342,9 +344,9 @@
                     loc[0] + rootView.getWidth(), loc[1] + rootView.getHeight());
             clipHelper.updateSource(homeBounds, runningTaskTarget);
 
-            Rect targetRect = new Rect();
-            mHelper.getSwipeUpDestinationAndLength(
-                    mActivity.getDeviceProfile(), mActivity, targetRect);
+            TransformedRect targetRect = new TransformedRect();
+            mHelper.getSwipeUpDestinationAndLength(mActivity.getDeviceProfile(), mActivity,
+                    INTERACTION_NORMAL, targetRect);
             clipHelper.updateTargetRect(targetRect);
             clipHelper.prepareAnimation(false /* isOpening */);
 
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 84b2176..e93c807 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -65,6 +65,7 @@
 import com.android.quickstep.ActivityControlHelper.LayoutListener;
 import com.android.quickstep.TouchConsumer.InteractionType;
 import com.android.quickstep.util.ClipAnimationHelper;
+import com.android.quickstep.util.TransformedRect;
 import com.android.quickstep.util.RemoteAnimationTargetSet;
 import com.android.quickstep.views.RecentsView;
 import com.android.quickstep.views.TaskView;
@@ -181,7 +182,7 @@
     private LayoutListener mLayoutListener;
     private RecentsView mRecentsView;
     private QuickScrubController mQuickScrubController;
-    private AnimationFactory mAnimationFactory = (t) -> { };
+    private AnimationFactory mAnimationFactory = (t, i) -> { };
 
     private Runnable mLauncherDrawnCallback;
 
@@ -302,9 +303,9 @@
     private void initTransitionEndpoints(DeviceProfile dp) {
         mDp = dp;
 
-        Rect tempRect = new Rect();
+        TransformedRect tempRect = new TransformedRect();
         mTransitionDragLength = mActivityControlHelper
-                .getSwipeUpDestinationAndLength(dp, mContext, tempRect);
+                .getSwipeUpDestinationAndLength(dp, mContext, mInteractionType, tempRect);
         mClipAnimationHelper.updateTargetRect(tempRect);
     }
 
@@ -488,7 +489,7 @@
      */
     public void buildAnimationController() {
         initTransitionEndpoints(mActivity.getDeviceProfile());
-        mAnimationFactory.createActivityController(mTransitionDragLength);
+        mAnimationFactory.createActivityController(mTransitionDragLength, mInteractionType);
     }
 
     private void onAnimatorPlaybackControllerCreated(AnimatorPlaybackController anim) {
@@ -793,13 +794,16 @@
             int scrollForFirstTask = mRecentsView.getScrollForPage(0);
             int scrollForSecondTask = mRecentsView.getChildCount() > 1
                     ? mRecentsView.getScrollForPage(1) : scrollForFirstTask;
-            int offsetFromFirstTask = scrollForFirstTask - scrollForSecondTask;
-            final float interpolation;
-            if (mRecentsView.getWidth() == 0) {
-                interpolation = scrollForSecondTask == scrollForFirstTask ? 0 : 1;
-            } else {
-                interpolation = (float) offsetFromFirstTask / (mRecentsView.getWidth() / 2);
-            }
+            float offsetFromFirstTask = scrollForFirstTask - scrollForSecondTask;
+
+            TransformedRect tempRect = new TransformedRect();
+            mActivityControlHelper
+                    .getSwipeUpDestinationAndLength(mDp, mContext, mInteractionType, tempRect);
+            float distanceToReachEdge = mDp.widthPx / 2 + tempRect.rect.width() / 2 +
+                    mContext.getResources().getDimensionPixelSize(R.dimen.recents_page_spacing);
+            float interpolation = Math.min(1,
+                    Math.abs(offsetFromFirstTask) / distanceToReachEdge);
+
             mClipAnimationHelper.offsetTarget(
                     firstTask.getCurveScaleForInterpolation(interpolation), offsetFromFirstTask,
                     mActivityControlHelper.getTranslationYForQuickScrub(mActivity),
diff --git a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
index 8c7f104..cc24f1d 100644
--- a/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -80,6 +80,7 @@
     private final RectF mTmpRectF = new RectF();
 
     private float mTargetScale = 1f;
+    private float mOffsetScale = 1f;
     private Interpolator mInterpolator = LINEAR;
     // We translate y slightly faster than the rest of the animation for quick scrub.
     private Interpolator mOffsetYInterpolator = LINEAR;
@@ -106,11 +107,13 @@
         updateSourceStack(target);
     }
 
-    public void updateTargetRect(Rect targetRect) {
+    public void updateTargetRect(TransformedRect targetRect) {
+        mOffsetScale = targetRect.scale;
         mSourceRect.set(mSourceInsets.left, mSourceInsets.top,
                 mSourceStackBounds.width() - mSourceInsets.right,
                 mSourceStackBounds.height() - mSourceInsets.bottom);
-        mTargetRect.set(targetRect);
+        mTargetRect.set(targetRect.rect);
+        Utilities.scaleRectFAboutCenter(mTargetRect, targetRect.scale);
         mTargetRect.offset(mHomeStackBounds.left - mSourceStackBounds.left,
                 mHomeStackBounds.top - mSourceStackBounds.top);
 
@@ -145,7 +148,8 @@
 
         synchronized (mTargetOffset) {
             // Stay lined up with the center of the target, since it moves for quick scrub.
-            currentRect.offset(mTargetOffset.x * progress, mTargetOffset.y  * offsetYProgress);
+            currentRect.offset(mTargetOffset.x * mOffsetScale * progress,
+                    mTargetOffset.y  * offsetYProgress);
         }
 
         mClipRect.left = (int) (mSourceWindowClipInsets.left * progress);
@@ -219,8 +223,8 @@
             mSourceInsets.set(activity.getDeviceProfile().getInsets());
         }
 
-        Rect targetRect = new Rect();
-        dl.getDescendantRectRelativeToSelf(ttv, targetRect);
+        TransformedRect targetRect = new TransformedRect();
+        dl.getDescendantRectRelativeToSelf(ttv, targetRect.rect);
         updateTargetRect(targetRect);
 
         // Transform the clip relative to the target rect.
diff --git a/quickstep/src/com/android/quickstep/util/TransformedRect.java b/quickstep/src/com/android/quickstep/util/TransformedRect.java
new file mode 100644
index 0000000..79f11e4
--- /dev/null
+++ b/quickstep/src/com/android/quickstep/util/TransformedRect.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2018 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 android.graphics.Rect;
+
+/**
+ * A wrapper around {@link Rect} with additional transformation properties
+ */
+public class TransformedRect {
+
+    public final Rect rect = new Rect();
+    public float scale = 1;
+
+    public void set(TransformedRect transformedRect) {
+        rect.set(transformedRect.rect);
+        scale = transformedRect.scale;
+    }
+}
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 186de36..4f169fb 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -47,7 +47,6 @@
 import android.text.TextPaint;
 import android.util.ArraySet;
 import android.util.AttributeSet;
-import android.util.FloatProperty;
 import android.util.SparseBooleanArray;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -100,18 +99,6 @@
 
     private final Rect mTempRect = new Rect();
 
-    public static final FloatProperty<RecentsView> ADJACENT_SCALE =
-            new FloatProperty<RecentsView>("adjacentScale") {
-        @Override
-        public void setValue(RecentsView recentsView, float v) {
-            recentsView.setAdjacentScale(v);
-        }
-
-        @Override
-        public Float get(RecentsView recentsView) {
-            return recentsView.mAdjacentScale;
-        }
-    };
     private static final int DISMISS_TASK_DURATION = 300;
     // The threshold at which we update the SystemUI flags when animating from the task into the app
     private static final float UPDATE_SYSUI_FLAGS_THRESHOLD = 0.6f;
@@ -122,6 +109,7 @@
     private final QuickScrubController mQuickScrubController;
     private final float mFastFlingVelocity;
     private final RecentsModel mModel;
+    private final int mTaskTopMargin;
 
     private final ScrollState mScrollState = new ScrollState();
     // Keeps track of the previously known visible tasks for purposes of loading/unloading task data
@@ -232,8 +220,6 @@
 
     @ViewDebug.ExportedProperty(category = "launcher")
     private float mContentAlpha = 1;
-    @ViewDebug.ExportedProperty(category = "launcher")
-    private float mAdjacentScale = 1;
 
     // Keeps track of task views whose visual state should not be reset
     private ArraySet<TaskView> mIgnoreResetTaskViews = new ArraySet<>();
@@ -271,6 +257,8 @@
 
         mIsRtl = !Utilities.isRtl(getResources());
         setLayoutDirection(mIsRtl ? View.LAYOUT_DIRECTION_RTL : View.LAYOUT_DIRECTION_LTR);
+        mTaskTopMargin = getResources()
+                .getDimensionPixelSize(R.dimen.task_thumbnail_top_margin);
 
         mEmptyIcon = context.getDrawable(R.drawable.ic_empty_recents);
         mEmptyIcon.setCallback(this);
@@ -518,8 +506,7 @@
         DeviceProfile dp = mActivity.getDeviceProfile();
         getTaskSize(dp, mTempRect);
 
-        mTempRect.top -= getResources()
-                .getDimensionPixelSize(R.dimen.task_thumbnail_top_margin);
+        mTempRect.top -= mTaskTopMargin;
         setPadding(mTempRect.left - mInsets.left, mTempRect.top - mInsets.top,
                 dp.availableWidthPx + mInsets.left - mTempRect.right,
                 dp.availableHeightPx + mInsets.top - mTempRect.bottom);
@@ -1038,36 +1025,7 @@
         updateClearAllButtonAlpha();
     }
 
-    public void setAdjacentScale(float adjacentScale) {
-        if (mAdjacentScale == adjacentScale) {
-            return;
-        }
-        mAdjacentScale = adjacentScale;
-        TaskView currTask = getPageAt(mCurrentPage);
-        if (currTask == null) {
-            return;
-        }
-        currTask.setZoomScale(mAdjacentScale);
-
-        if (mCurrentPage - 1 >= 0) {
-            TaskView adjacentTask = getPageAt(mCurrentPage - 1);
-            float[] scaleAndTranslation = getAdjacentScaleAndTranslation(currTask, adjacentTask,
-                    mAdjacentScale, 0);
-            adjacentTask.setZoomScale(scaleAndTranslation[0]);
-            adjacentTask.setTranslationX(-scaleAndTranslation[1]);
-            adjacentTask.setTranslationY(scaleAndTranslation[2]);
-        }
-        if (mCurrentPage + 1 < getChildCount()) {
-            TaskView adjacentTask = getPageAt(mCurrentPage + 1);
-            float[] scaleAndTranslation = getAdjacentScaleAndTranslation(currTask, adjacentTask,
-                    mAdjacentScale, 0);
-            adjacentTask.setZoomScale(scaleAndTranslation[0]);
-            adjacentTask.setTranslationX(scaleAndTranslation[1]);
-            adjacentTask.setTranslationY(scaleAndTranslation[2]);
-        }
-    }
-
-    private float[] getAdjacentScaleAndTranslation(TaskView currTask, TaskView adjacentTask,
+    private float[] getAdjacentScaleAndTranslation(TaskView currTask,
             float currTaskToScale, float currTaskToTranslationY) {
         float displacement = currTask.getWidth() * (currTaskToScale - currTask.getCurveScale());
         sTempFloatArray[0] = currTaskToScale;
@@ -1080,7 +1038,6 @@
     public void onViewAdded(View child) {
         super.onViewAdded(child);
         child.setAlpha(mContentAlpha);
-        setAdjacentScale(mAdjacentScale);
         onChildViewsChanged();
     }
 
@@ -1106,6 +1063,12 @@
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
         super.onLayout(changed, left, top, right, bottom);
         updateEmptyStateUi(changed);
+
+        // Set the pivot points to match the task preview center
+        setPivotY(((mInsets.top + getPaddingTop() + mTaskTopMargin)
+                + (getHeight() - mInsets.bottom - getPaddingBottom())) / 2);
+        setPivotX(((mInsets.left + getPaddingLeft())
+                + (getWidth() - mInsets.right - getPaddingRight())) / 2);
     }
 
     private void updateEmptyStateUi(boolean sizeChanged) {
@@ -1176,14 +1139,14 @@
             if (taskIndex - 1 >= 0) {
                 TaskView adjacentTask = getPageAt(taskIndex - 1);
                 float[] scaleAndTranslation = getAdjacentScaleAndTranslation(centerTask,
-                        adjacentTask, toScale, toTranslationY);
+                        toScale, toTranslationY);
                 scaleAndTranslation[1] = -scaleAndTranslation[1];
                 anim.play(createAnimForChild(adjacentTask, scaleAndTranslation));
             }
             if (taskIndex + 1 < getPageCount()) {
                 TaskView adjacentTask = getPageAt(taskIndex + 1);
                 float[] scaleAndTranslation = getAdjacentScaleAndTranslation(centerTask,
-                        adjacentTask, toScale, toTranslationY);
+                        toScale, toTranslationY);
                 anim.play(createAnimForChild(adjacentTask, scaleAndTranslation));
             }
         } else {
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index efbd004..5cc2e8f 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -440,9 +440,7 @@
             if (getUnboundedScrollX() != mScroller.getCurrX()
                     || getScrollY() != mScroller.getCurrY()
                     || mOverScrollX != mScroller.getCurrX()) {
-                float scaleX = mFreeScroll ? getScaleX() : 1f;
-                int scrollX = (int) (mScroller.getCurrX() * (1 / scaleX));
-                scrollTo(scrollX, mScroller.getCurrY());
+                scrollTo(mScroller.getCurrX(), mScroller.getCurrY());
             }
             if (shouldInvalidate) {
                 invalidate();
