material-motion-android icon indicating copy to clipboard operation
material-motion-android copied to clipboard

Deprecate physics-android and use DynamicAnimation in supportlib

Open pingpongboss opened this issue 7 years ago • 1 comments

pingpongboss avatar Mar 30 '17 22:03 pingpongboss

SpringAnimation requires the caller to pass in the View target and ViewProperty property ahead of time. The API looks like this:

SpringAnimation spring = new SpringAnimation(viewTarget, DynamicAnimation.X);
spring.start();

The SpringAnimation is responsible for writing to the target's property on every time step.

This is not compatible with Android's current data pipeline setup, where the writing's responsibility lies with the runtime:

MotionObservable stream = source().operator().operator();
runtime.write(stream, target, property);

However, it is similar to the coreAnimation channel introduced in material-motion-swift.

pingpongboss avatar Apr 18 '17 01:04 pingpongboss