Fix jumpiness when dragging surface down and up.

Currently the overshoot only works when you first open all apps and try
to extend the all apps to the top (making it overshoot). This pull works
when you go mFromState:Normal -> mToState:AllApps. However once the all
apps is set and you move the surface down then up..that overshoot
animation jumps AFTER your finger goes all the way up and off the
screen. At this point, once all apps is completely opened.. the states are
mFromState:AllApps -> mToState:Normal.

Now with this change, it addresses the jumpiness by considering the
current states (mFromState==AllApps) by
including the same onPull() but with different calculations

bug: 240669628
test: manual - videos included in bug thread
Change-Id: I7873f1ec22574f87fab3d2f11d1f5a5f81dfb5bc
This commit is contained in:
Brandon Dayauon
2022-08-11 19:46:51 +00:00
parent 13aa345755
commit d4a60b394f

View File

@@ -32,6 +32,7 @@ import static com.android.launcher3.util.window.RefreshRateTracker.getSingleFram
import android.animation.Animator.AnimatorListener;
import android.animation.ValueAnimator;
import android.util.Log;
import android.view.MotionEvent;
import com.android.launcher3.Launcher;
@@ -211,6 +212,10 @@ public abstract class AbstractStateChangeTouchController
mFlingBlockCheck.blockFling();
}
}
if (mFromState == LauncherState.ALL_APPS) {
mAllAppsOvershootStarted = true;
mLauncher.getAppsView().onPull(-progress , -progress);
}
} else if (progress >= 1) {
if (reinitCurrentAnimation(true, isDragTowardPositive)) {
mDisplacementShift = displacement;