Fix some task view fling calculations

- Map to progress 1 instead of dividing by 0 if expectedDuration == 0
- Map to starting progress one frame ahead based on velocity
- Change direction of velocity so it's in the same direction as the
  task progress (0 is down and 1 is up).

Change-Id: I5ac3f8a0d6c616bd303ac1a902242964bb33d3c7
This commit is contained in:
Tony Wickham committed 2020-12-16 09:31:26 -08:00
1 parent 64594c803a
commit b956a03067
2 files changed
+30 -12

No files matched your search

@@ -297,7 +297,8 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
mCurrentAnimation.setEndAction(this::clearState);
mCurrentAnimation.startWithVelocity(mActivity, goingToEnd,
velocity, mEndDisplacement, animationDuration);
velocity * orientationHandler.getSecondaryTranslationDirectionFactor(),
mEndDisplacement, animationDuration);
}
private void clearState() {