Skip to content

Commit

Permalink
Add keyframe guide.
Browse files Browse the repository at this point in the history
Summary: Fixes #7

Reviewers: O2 Material Motion, featherless

Reviewed By: O2 Material Motion, featherless

Tags: #material_motion

Differential Revision: http://codereview.cc/D2084
  • Loading branch information
Mark Wei committed Nov 30, 2016
1 parent e4e57cc commit 191cecb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ To run all unit tests, run the following commands:
## Guides

1. [How to animate a property with a Tween plan](#how-to-animate-a-property-with-a-tween-plan)
1. [How to animate a property with a keyframe Tween plan](#how-to-animate-a-property-with-a-keyframe-tween-plan)

### How to animate a property with a Tween plan

Expand All @@ -122,6 +123,17 @@ Tween tween = new Tween<>(property, duration, from, to);
runtime.addPlan(tween, view);
```

### How to animate a property with a keyframe Tween plan

```java
float[] values = new float[] {0f, .5f, 1f};
float[] offsets = new float[] {0f, .25f, 1f};

Tween tween = new Tween<>(property, duration, values);
tween.offsets = offsets;
runtime.addPlan(tween, view);
```

## Contributing

We welcome contributions!
Expand Down

0 comments on commit 191cecb

Please sign in to comment.