Skip to content

[Animated] Holds a InteractionManager handle for the entirety of each animation #2434

Closed
@almost

Description

@almost

Animated grabs an interaction handle at the beginning of an animations and doesn't release it to the end. I see why it's doing this (so less important stuff doesn't interfere with the animation) but there are totally legitimate situations in which animations will be happening all the time without gaps so that the stuff waiting on InteractionManager will never get run).

A nasty example I've just encountered is a loading spinner that uses Animated to spin itself, while the loading spinner is showing my actually loading code will never run (since it tries to be friendly and wait for interactions to finish first).

A few solutions I can think off:

  1. Make sure that if an InteractionManager handle is created then released then another is created just after that any waiting actions get performed first. The problem here is that if the interactions are real user interactions then we probably want to wait.
  2. Don't grab an InteractionManager handle from Animated. This has the disadvantage that short animations which would have run smoother had that been done without any other negative effects will be impacted.
  3. Add an option to Animated to turn off InteractionManager stuff for just one animation. This does add extra API surface area (and in a way makes it easy to shoot yourself in the foot)

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions