summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-04-06 14:22:46 -0700
committerTony Wickham <twickham@google.com>2018-04-06 14:32:18 -0700
commit6270a0ea18d27952fec20da04d64ca4f7e223849 (patch)
tree3c263280970b36b02981aaf4a1ec2733fb00a061 /src
parentb3ad0edc1476ae1562bb5e0b26f253b2e504285f (diff)
downloadandroid_packages_apps_Trebuchet-6270a0ea18d27952fec20da04d64ca4f7e223849.tar.gz
android_packages_apps_Trebuchet-6270a0ea18d27952fec20da04d64ca4f7e223849.tar.bz2
android_packages_apps_Trebuchet-6270a0ea18d27952fec20da04d64ca4f7e223849.zip
When dragging past first or last state, don't reinit target
Example bug: 1. Swipe up to overview and let go 2. Swipe all the way to the top of the screen, past where all apps stops 3. Swipe down Before this change, you get reset in NORMAL state instead of OVERVIEW. By ensuring that getTargetState() checks the drag direction before returning a new state, we guarantee we only re-init in the case that the state is actually changing. Otherwise it's possible to change the state to one that is impossible, such as NORMAL when swiping up from ALL APPS. Change-Id: I19913dded9c94228d06289780b6400e99403f378
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/touch/AbstractStateChangeTouchController.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 9726704dd..3d85ac3c6 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -124,6 +124,10 @@ public abstract class AbstractStateChangeTouchController extends AnimatorListene
return mLauncher.getAllAppsController().getShiftRange();
}
+ /**
+ * Returns the state to go to from fromState given the drag direction. If there is no state in
+ * that direction, returns fromState.
+ */
protected abstract LauncherState getTargetState(LauncherState fromState,
boolean isDragTowardPositive);