Pausing an animation that was playing when hidden will play again on resume
See original GitHub issueThis 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:
- Start a looping animation
- Put the app in the background
- 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:
- Created 5 years ago
- Comments:9
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

If animation had been looping before app was minimized, shouldn’t animation resume playing when app is restored/reopened? @thierryd
@thierryd I would accept a PR that flips those flags in play/pause/resume/cancel