From 9e19866ed86de5237ea02810e28fb56f3ab80616 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 11 Mar 2020 14:42:02 -0700 Subject: [PATCH] Only allow horizontal spring if page will change. Bug: 150876921 Change-Id: I88db4c28ec3f8213c583e8a0dcd1cce2b1fee322 --- src/com/android/launcher3/PagedView.java | 31 ++++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index a6180a6360..608d60c4ad 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -42,21 +42,6 @@ import android.view.accessibility.AccessibilityNodeInfo; import android.view.animation.Interpolator; import android.widget.ScrollView; -import com.android.launcher3.anim.Interpolators; -import com.android.launcher3.compat.AccessibilityManagerCompat; -import com.android.launcher3.config.FeatureFlags; -import com.android.launcher3.model.PagedViewOrientedState; -import com.android.launcher3.pageindicators.PageIndicator; -import com.android.launcher3.states.RotationHelper; -import com.android.launcher3.touch.PortraitPagedViewHandler; -import com.android.launcher3.touch.OverScroll; -import com.android.launcher3.touch.PagedOrientationHandler; -import com.android.launcher3.touch.PagedOrientationHandler.ChildBounds; -import com.android.launcher3.util.OverScroller; -import com.android.launcher3.util.Thunk; - -import java.util.ArrayList; - import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled; import static com.android.launcher3.compat.AccessibilityManagerCompat.isObservedEventType; import static com.android.launcher3.config.FeatureFlags.QUICKSTEP_SPRINGS; @@ -65,6 +50,20 @@ import static com.android.launcher3.touch.PagedOrientationHandler.CANVAS_TRANSLA import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_BY; import static com.android.launcher3.touch.PagedOrientationHandler.VIEW_SCROLL_TO; +import com.android.launcher3.anim.Interpolators; +import com.android.launcher3.compat.AccessibilityManagerCompat; +import com.android.launcher3.config.FeatureFlags; +import com.android.launcher3.model.PagedViewOrientedState; +import com.android.launcher3.pageindicators.PageIndicator; +import com.android.launcher3.touch.OverScroll; +import com.android.launcher3.touch.PagedOrientationHandler; +import com.android.launcher3.touch.PagedOrientationHandler.ChildBounds; +import com.android.launcher3.touch.PortraitPagedViewHandler; +import com.android.launcher3.util.OverScroller; +import com.android.launcher3.util.Thunk; + +import java.util.ArrayList; + /** * An abstraction of the original Workspace which supports browsing through a * sequential list of "pages" @@ -1515,7 +1514,7 @@ public abstract class PagedView extends ViewGrou // interpolator at zero, ie. 5. We use 4 to make it a little slower. duration = 4 * Math.round(1000 * Math.abs(distance / velocity)); - if (QUICKSTEP_SPRINGS.get()) { + if (QUICKSTEP_SPRINGS.get() && mCurrentPage != whichPage) { return snapToPage(whichPage, delta, duration, false, null, velocity * Math.signum(delta), true); } else {