diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java index 6271a44b53..faf5054007 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TwoButtonNavbarTouchController.java @@ -31,6 +31,7 @@ import com.android.launcher3.states.StateAnimationConfig.AnimationFlags; import com.android.launcher3.touch.AbstractStateChangeTouchController; import com.android.launcher3.touch.SingleAxisSwipeDetector; import com.android.quickstep.SystemUiProxy; +import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.views.AllAppsEduView; /** @@ -92,7 +93,8 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont mLauncher.getDeviceProfile().isSeascape() == isDragTowardPositive; return draggingFromNav ? OVERVIEW : NORMAL; } else { - return isDragTowardPositive ^ (fromState == OVERVIEW) ? OVERVIEW : NORMAL; + LauncherState startState = mStartState != null ? mStartState : fromState; + return isDragTowardPositive ^ (startState == OVERVIEW) ? OVERVIEW : NORMAL; } } @@ -106,8 +108,8 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont @Override protected float getShiftRange() { - return mLauncher.getDeviceProfile().isVerticalBarLayout() - ? mLauncher.getDragLayer().getWidth() : super.getShiftRange(); + // Should be in sync with TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT + return LayoutUtils.getDefaultSwipeHeight(mLauncher, mLauncher.getDeviceProfile()); } @Override @@ -116,7 +118,7 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont long maxAccuracy = (long) (2 * range); mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace(mToState, maxAccuracy, animComponent); - return (mLauncher.getDeviceProfile().isSeascape() ? 2 : -2) / range; + return (mLauncher.getDeviceProfile().isSeascape() ? 1 : -1) / range; } @Override @@ -134,5 +136,6 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont AllAppsEduView.show(mLauncher); } } + mStartState = null; } } diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java index 65df6144e5..b28d6f7b8f 100644 --- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java +++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java @@ -67,8 +67,9 @@ public abstract class AbstractStateChangeTouchController /** * Play an atomic recents animation when the progress from NORMAL to OVERVIEW reaches this. + * TODO: Remove the atomic animation altogether and just go to OVERVIEW directly (b/175137718). */ - public static final float ATOMIC_OVERVIEW_ANIM_THRESHOLD = 0.5f; + public static final float ATOMIC_OVERVIEW_ANIM_THRESHOLD = 1f; protected final long ATOMIC_DURATION = getAtomicDuration(); protected final Launcher mLauncher; @@ -342,9 +343,7 @@ public abstract class AbstractStateChangeTouchController if (!goingBetweenNormalAndOverview(fromState, toState)) { return; } - float threshold = toState == OVERVIEW ? ATOMIC_OVERVIEW_ANIM_THRESHOLD - : 1f - ATOMIC_OVERVIEW_ANIM_THRESHOLD; - boolean passedThreshold = progress >= threshold; + boolean passedThreshold = progress >= ATOMIC_OVERVIEW_ANIM_THRESHOLD; if (passedThreshold != mPassedOverviewAtomicThreshold) { LauncherState atomicFromState = passedThreshold ? fromState: toState; LauncherState atomicToState = passedThreshold ? toState : fromState;