Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setAutoRepeat false not working, keeps repeating #20

Closed
hannojg opened this issue Jun 13, 2022 · 4 comments
Closed

setAutoRepeat false not working, keeps repeating #20

hannojg opened this issue Jun 13, 2022 · 4 comments

Comments

@hannojg
Copy link

hannojg commented Jun 13, 2022

Example reproduction code:

setLottieDrawable(
  AXrLottieDrawable.fromJson(jsonString, cacheKey)
      .setSize(decodeWidth, decodeHeight)
      .setAutoRepeat(false)
      .setSpeed(speed) // speed is set to 1.0f
      .build()
);

playAnimation();

Observation vs. Expectation

I expect the animation to only play once, and then stop. However, the animation keeps repeating.

@mojtabasheikhy
Copy link

I have the same problem

@Aghajari
Copy link
Owner

Aghajari commented Aug 15, 2022

Hi @mojtabasheikhy and @hannojg,
Auto repeat is based on AXrLottieImageView's autoRepeat property.
AXrLottieDrawable's autoRepeat only matters if you are not using AXrLottieImageView.
Or you can change the auto repeat on AXrLottieDrawable after calling AXrLottieImageView#setLottieDrawable.

This code should work:

lottieView.setAutoRepeat(false);

lottieView.setLottieDrawable(
  AXrLottieDrawable.fromJson(jsonString, cacheKey)
      .setSize(decodeWidth, decodeHeight)
      .build()
);

lottieView.playAnimation();

let me know if it didn't. Thanks!

@Aghajari
Copy link
Owner

Aghajari commented Oct 1, 2022

Fixed on v1.4.0

@Aghajari Aghajari closed this as completed Oct 1, 2022
@mojtabasheikhy
Copy link

Hi @mojtabasheikhy and @hannojg, Auto repeat is based on AXrLottieImageView's autoRepeat property. AXrLottieDrawable's autoRepeat only matters if you are not using AXrLottieImageView. Or you can change the auto repeat on AXrLottieDrawable after calling AXrLottieImageView#setLottieDrawable.

This code should work:

lottieView.setAutoRepeat(false);

lottieView.setLottieDrawable(
  AXrLottieDrawable.fromJson(jsonString, cacheKey)
      .setSize(decodeWidth, decodeHeight)
      .build()
);

lottieView.playAnimation();

let me know if it didn't. Thanks!

Thanks, it's fixed 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants