Merge "Removing a workaround to make NevigationModeSwitchRule pass on CF" into ub-launcher3-master
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java
index 23db5df..f82af62 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionRowView.java
@@ -276,7 +276,7 @@
         boolean predictionsEnabled = predictionCount > 0;
         if (predictionsEnabled != mPredictionsEnabled) {
             mPredictionsEnabled = predictionsEnabled;
-            mLauncher.reapplyUi();
+            mLauncher.reapplyUi(false /* cancelCurrentAnimation */);
             updateVisibility();
         }
         mParent.onHeightUpdated();
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
index 05cec2d..c28bf28 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherSwipeHandler.java
@@ -167,8 +167,6 @@
     private boolean mIsShelfPeeking;
 
     private boolean mContinuingLastGesture;
-    // To avoid UI jump when gesture is started, we offset the animation by the threshold.
-    private float mShiftAtGestureStart = 0;
 
     private ThumbnailData mTaskSnapshot;
 
@@ -574,9 +572,7 @@
         // Normalize the progress to 0 to 1, as the animation controller will clamp it to that
         // anyway. The controller mimics the drag length factor by applying it to its interpolators.
         float progress = mCurrentShift.value / mDragLengthFactor;
-        mLauncherTransitionController.setPlayFraction(
-                progress <= mShiftAtGestureStart || mShiftAtGestureStart >= 1
-                        ? 0 : (progress - mShiftAtGestureStart) / (1 - mShiftAtGestureStart));
+        mLauncherTransitionController.setPlayFraction(progress);
     }
 
     /**
@@ -623,7 +619,6 @@
     @Override
     public void onGestureStarted() {
         notifyGestureStartedAsync();
-        mShiftAtGestureStart = mCurrentShift.value;
         mStateCallback.setStateOnUiThread(STATE_GESTURE_STARTED);
         mGestureStarted = true;
     }
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b3b2df6..cb8fe05 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -508,12 +508,16 @@
 
     @Override
     public void reapplyUi() {
+        reapplyUi(true /* cancelCurrentAnimation */);
+    }
+
+    public void reapplyUi(boolean cancelCurrentAnimation) {
         if (supportsFakeLandscapeUI()) {
             mRotationMode = mStableDeviceProfile == null
                     ? RotationMode.NORMAL : getFakeRotationMode(mDeviceProfile);
         }
         getRootView().dispatchInsets();
-        getStateManager().reapplyState(true /* cancelCurrentAnimation */);
+        getStateManager().reapplyState(cancelCurrentAnimation);
     }
 
     @Override