question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pausing an animation that was playing when hidden will play again on resume

See original GitHub issue

This is similar to issue #987

But the fix proposed is incorrect, at least in my use case. I do think the fix is correct in some case: if the view is set from VISIBLE to GONE, then the animation must stop. But when the app is put in the background, onVisibilityChanged is not called. What is called is onWindowVisibilityChanged

To replicate the issue:

  1. Start a looping animation
  2. Put the app in the background
  3. Check the profiler in Android Studio

Expected result:

  • Nothing is running

What is happening:

  • The profiler shows that the animation still runs

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
soshialcommented, Nov 6, 2019

If animation had been looping before app was minimized, shouldn’t animation resume playing when app is restored/reopened? @thierryd

0reactions
gpealcommented, Mar 22, 2019

@thierryd I would accept a PR that flips those flags in play/pause/resume/cancel

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pausing and Resuming an Animation - Matplotlib
Pausing and Resuming an Animation#. This example showcases: using the Animation.pause() method to pause an animation. using the Animation.resume() method to ...
Read more >
Pause and Resume Lottie Animation - Stack Overflow
What you can do is use progress from LottieAnimationView, threads and a flag, this will allow you to pause at a certain progress...
Read more >
How to Play and Pause CSS Animations with CSS Custom ...
The only way to truly pause an animation in CSS is to use the animation-play-state property with a paused value. .paused { animation-play-state: ......
Read more >
Understanding Success Criterion 2.2.2: Pause, Stop, Hide
Having an animation stop only so long as a user has focus on it (where it restarts as soon as the user moves...
Read more >
animation-play-state - CSS: Cascading Style Sheets | MDN
Resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found