DynamicSpringSource better handles existing springs.
ClosedPublic

Authored by markwei on Thu, May 4, 6:21 PM.

Details

Summary

The old implementation would throw away old springs and create new ones.
The issue was the initialVelocity would always be set on the spring, even when the old spring was active.

The new implementation reuses old springs.
Properties like initialVelocity are only set on the initial spring.
This way, you can update an inflight spring with a new destination without resetting its velocity.

Diff Detail

Repository
rMDMSTREAMSANDROID reactive-motion-android
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
markwei created this revision.Thu, May 4, 6:21 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptThu, May 4, 6:21 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O6: Material Android platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
featherless accepted this revision.Fri, May 5, 1:27 PM
This revision is now accepted and ready to land.Fri, May 5, 1:27 PM
This revision was automatically updated to reflect the committed changes.