NativeScript / NativeScript/NativeScript
Ability to stop an animation, or cancel and not reset view property values
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.7k
- Forks
- 1.7k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 35
Description
I am frequently coming across a regular requirement to be able to stop an animation mid way through its animating period, and specifically ensuring that the animated view(s) properties remain in their last updated state by the animation engine.
Is the a reason why a .stop() method hasn't been provided, and are there any plans to support this?
Using the .cancel() method on an Animation will indeed stop the animation, but has the symptom of returning the animated view properties back to their original position so this is not an option.
Perhaps another solution would be the ability to pass in a boolean to the cancel method such as cancel(true) to indicate the intention not to "reset" the properties, but instead leave them as is, as when the animation was cancelled.
Any feedback on this would be greatly appreciated.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the Animation API, especially the existing cancel() behavior and how animated view properties are updated and restored. Compare the requested stop semantics with the current API and define whether stopping should preserve the latest values; done when the supported behavior and its expected outcome are clear and verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100