code: private void startAnimationInternal() {
          long duration = toController.getSettings().getAnimationsDuration();
          float durationFraction = toPosition == 1f
                  ? (isLeaving ? position : 1f - position)
                  : (isLeaving ? position / toPosition : (1f - position) / (1f - toPosition));
  
          positionScroller.setDuration((long) (duration * durationFraction));
          positionScroller.startScroll(position, isLeaving ? 0f : 1f);
          animationEngine.start();
          onAnimationStarted();
      }
docs: Starts animation from current position ({@link #position}) in current
  direction ({@link #isLeaving}).