public void setComposition(LottieComposition composition) {
    // Because the initial composition is loaded async, the first min/max frame may be set
    boolean keepMinAndMaxFrames = this.composition == null;
    this.composition = composition;

    if (keepMinAndMaxFrames) {
      setMinAndMaxFrames(
          Math.max(this.minFrame, composition.getStartFrame()),
          Math.min(this.maxFrame, composition.getEndFrame())
      );
    } else {
      setMinAndMaxFrames((int) composition.getStartFrame(), (int) composition.getEndFrame());
    }
    float frame = this.frame;
    this.frame = 0f;
    this.frameRaw = 0f;
    setFrame((int) frame);
    notifyUpdate();
  }
Returns the current value of the currently playing animation taking into
account direction, min and max frames.
lottie/src/main/java/com/airbnb/lottie/utils/LottieValueAnimator.java