From a5209e33fcce5cd429086971ef1b57bcfc106c23 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 19 Nov 2015 12:45:30 -0800 Subject: [PATCH] Disallow scrolling if workspace is in transition. Because going to overview mode scales down the workspace, it was thinking the touch was moving even though your finger was still. If the "movement" was large enough, it was treated as a scroll, causing jank. This was especially prevalent on tablets due to their size. Bug: 25779718 Change-Id: Idb7833e0087bd24ca840f6afc451bf221f6bc047 --- .../launcher3/LauncherStateTransitionAnimation.java | 6 +++--- src/com/android/launcher3/Workspace.java | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index 3391d06c12..83b12a99d7 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -641,11 +641,11 @@ public class LauncherStateTransitionAnimation { } animation.play(reveal); } - - dispatchOnLauncherTransitionPrepare(fromView, animated, true); - dispatchOnLauncherTransitionPrepare(toView, animated, true); } + dispatchOnLauncherTransitionPrepare(fromView, animated, true); + dispatchOnLauncherTransitionPrepare(toView, animated, true); + animation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index f046fbd3c8..88a4c19abe 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -1543,6 +1543,13 @@ public class Workspace extends PagedView mWallpaperOffset.syncWithScroll(); } + @Override + protected void determineScrollingStart(MotionEvent ev, float touchSlopScale) { + if (!isSwitchingState()) { + super.determineScrollingStart(ev, touchSlopScale); + } + } + @Override public void announceForAccessibility(CharSequence text) { // Don't announce if apps is on top of us.