summaryrefslogtreecommitdiffstats
path: root/src_ui_overrides
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-03-28 11:21:49 -0700
committerTony <twickham@google.com>2018-04-03 11:18:18 -0700
commit274b9529fff4df680069afbff51f294346c9f4f7 (patch)
tree3973a7970e0d597e3fe5d72aa5c3209aa05ad228 /src_ui_overrides
parent86d7b2d81d94ac181d3619444e93ed029197cc06 (diff)
downloadandroid_packages_apps_Trebuchet-274b9529fff4df680069afbff51f294346c9f4f7.tar.gz
android_packages_apps_Trebuchet-274b9529fff4df680069afbff51f294346c9f4f7.tar.bz2
android_packages_apps_Trebuchet-274b9529fff4df680069afbff51f294346c9f4f7.zip
Support swiping between states
- Swiping down on hotseat from overview goes to workspace - Can swipe up through overview to get to all apps Bug: 76449024 Change-Id: I7f76d92da976e268cc2a97e55746cca4603e6620
Diffstat (limited to 'src_ui_overrides')
-rw-r--r--src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
index e495477f5..c97c3ccec 100644
--- a/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
+++ b/src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java
@@ -7,6 +7,7 @@ import android.view.MotionEvent;
import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherState;
import com.android.launcher3.touch.AbstractStateChangeTouchController;
import com.android.launcher3.touch.SwipeDetector;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
@@ -43,12 +44,8 @@ public class AllAppsSwipeController extends AbstractStateChangeTouchController {
protected int getSwipeDirection(MotionEvent ev) {
if (mLauncher.isInState(ALL_APPS)) {
mStartContainerType = ContainerType.ALLAPPS;
- mFromState = ALL_APPS;
- mToState = NORMAL;
return SwipeDetector.DIRECTION_NEGATIVE;
} else {
- mFromState = NORMAL;
- mToState = ALL_APPS;
mStartContainerType = mLauncher.getDragLayer().isEventOverHotseat(ev) ?
ContainerType.HOTSEAT : ContainerType.WORKSPACE;
return SwipeDetector.DIRECTION_POSITIVE;
@@ -56,6 +53,11 @@ public class AllAppsSwipeController extends AbstractStateChangeTouchController {
}
@Override
+ protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) {
+ return fromState == ALL_APPS ? NORMAL : ALL_APPS;
+ }
+
+ @Override
protected float initCurrentAnimation() {
float range = getShiftRange();
long maxAccuracy = (long) (2 * range);