Git Product home page Git Product logo

Comments (1)

davidganster avatar davidganster commented on September 25, 2024

Hi Stephan,

thanks, glad you like the library!

These features are unfortunately not supported at the moment due to a conflict with how additive animations and animation chaining work conceptually.

Consider this animation:

val animator1 = AdditiveAnimator.animate(view1)
        .alpha(0f)
        .then()
        .alpha(1f)
        .then()
        .target(view2)
        .x(200)
animator1.start()

// wait a little, then make another animation:
AdditiveAnimator.animate(view2).x(100).then().target(view1).alpha(0.5f).start()

// now reset the first one
animator1.reset()

What would you expect the alpha value of view1 to be after the call to 'reset'? What should the x value of view2 be? What would happen to the second running animation on x of view2, would that also be cancelled? (If not, the view won't arrive at x = 100, because that animation assumed that the previous animation would finish – that's why cancelling an animation affects all running animations on a property)
All of these considerations would also have to be made for pausing, resuming and reversing – and I couldn't get a good answer that makes sense in all cases.

That said, implementing pausing/resuming/scrubbing for non-chained animations is rather straight-forward since AdditiveAnimator uses a ValueAnimator under the hood – I'm just not sure I want to add a feature that is not fully supported in every configuration since that might lead to confusion about correct usage.

Can you give some context as to what you're trying to achieve?
There is usually no need to reset and reverse animations manually, and pausing/resuming can be done by simply cancelling the running animations and making new ones when necessary.
I understand that the animation curve might not be what you want with this approach, but there might be an easy solution depending on the specific problem you're having.

Cheers,
David

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.