From 274b9529fff4df680069afbff51f294346c9f4f7 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 28 Mar 2018 11:21:49 -0700 Subject: 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 --- .../android/launcher3/uioverrides/AllAppsSwipeController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src_ui_overrides/com/android/launcher3/uioverrides/AllAppsSwipeController.java') 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,18 +44,19 @@ 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; } } + @Override + protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) { + return fromState == ALL_APPS ? NORMAL : ALL_APPS; + } + @Override protected float initCurrentAnimation() { float range = getShiftRange(); -- cgit v1.2.3