Git Product home page Git Product logo

Comments (8)

davidganster avatar davidganster commented on June 24, 2024

Hi @jemshit, that should be how you cancel animations...

Can you try doing AdditiveAnimator.cancelAnimations(image) to see if that works?

from android_additive_animations.

jemshit avatar jemshit commented on June 24, 2024

It works, thanks.

from android_additive_animations.

davidganster avatar davidganster commented on June 24, 2024

Glad you got it to work!

I'll look into why the method you tried didn't cancel the animations, can you post the full animation creation?

from android_additive_animations.

jemshit avatar jemshit commented on June 24, 2024

from android_additive_animations.

davidganster avatar davidganster commented on June 24, 2024

Thanks, I'll try to reproduce.

Btw, I will probably deprecate and later remove the cancel() methods from the animator to discourage storing animator objects.

from android_additive_animations.

jemshit avatar jemshit commented on June 24, 2024

from android_additive_animations.

davidganster avatar davidganster commented on June 24, 2024

Basically it was a design decision to dodge a set of issues that additive animations have - since they are inherently stateful, it's not obvious what should happen in the start - cancel - restart case:
Would the user expect the animation to restart where the view was when the animation was first created? Or should it restart from the current position?
How would that affect other running additive animations on the same property? What if you then()-chain more animations on the same animator after calling cancel()?

I didn't (and still don't) have good answers to these questions, and I don't think anything I could come up with would make intuitive sense in all cases.

The current API removes the statefulness by making animators single-use throwaway objects.

from android_additive_animations.

jemshit avatar jemshit commented on June 24, 2024

I get it 👍

from android_additive_animations.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.