Comments (1)
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)
- Gradle build failed HOT 4
- Leak HOT 9
- Properly blend delayed animations HOT 5
- Provide Kotlin extensions HOT 2
- Using setStartDelay after creating a staggered animation removes stagger
- Move to AndroidX HOT 3
- Move away from jcenter HOT 2
- Library sometimes crashes when mRunningAnimationsManager is null internally HOT 6
- Content gone in 1.9.2 but works in 1.9.1 HOT 2
- Remove gifs from this repo
- iOS? HOT 1
- superfluous? HOT 1
- purpose? HOT 1
- effect? HOT 1
- Annoying `AdditiveAnimator` constructor with Kotlin HOT 7
- Question HOT 13
- pivotXY for view rotation around center HOT 1
- Cancel repeating animation HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android_additive_animations.