| OLD | NEW |
| 1 Animation API | 1 Animation API |
| 2 ============= | 2 ============= |
| 3 | 3 |
| 4 (This is very incomplete, because it's all expected to be in the |
| 5 framework, not the platform.) |
| 6 |
| 4 ```javascript | 7 ```javascript |
| 5 | 8 |
| 6 dictionary EasingFunctionSettings { | 9 dictionary EasingFunctionSettings { |
| 7 Float duration; // required | 10 Float duration; // required |
| 8 Callback? completionCallback = null; | 11 Callback? completionCallback = null; |
| 9 } | 12 } |
| 10 | 13 |
| 11 abstract class EasingFunction { | 14 abstract class EasingFunction { |
| 12 abstract constructor (EasingFunctionSettings settings); | 15 abstract constructor (EasingFunctionSettings settings); |
| 13 abstract Float getFactor(Float time); | 16 abstract Float getFactor(Float time); |
| 14 // calls completionCallback if time >= duration | 17 // calls completionCallback if time >= duration |
| 15 // then returns a number ostensibly in the range 0.0 to 1.0 | 18 // then returns a number ostensibly in the range 0.0 to 1.0 |
| 16 // (but it could in practice go outside this range, e.g. for | 19 // (but it could in practice go outside this range, e.g. for |
| 17 // animation styles that overreach then come back) | 20 // animation styles that overreach then come back) |
| 18 } | 21 } |
| 22 ``` |
| 19 | 23 |
| 20 | 24 |
| 21 ``` | 25 If you want to have two animations simultaneously, e.g. two |
| 26 transforms, then you can add to the RenderNode's overrideStyles a |
| 27 StyleValue that combines other StyleValues, e.g. a |
| 28 "TransformStyleValueCombinerStyleValue", and then add to it the |
| 29 regular animated StyleValues, e.g. multiple |
| 30 "AnimatedTransformStyleValue" objects. A framework API could make |
| 31 setting all that up easy, given the right underlying StyleValue |
| 32 classes. |
| OLD | NEW |