diff options
| author | Doris Liu <tianliu@google.com> | 2016-06-09 23:33:50 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-06-09 23:33:51 +0000 |
| commit | ea06280b3ea753aea684910091bba2188f15025f (patch) | |
| tree | 20da0ba291a03e7a9430bde83aff590c2716a477 /core/java/android | |
| parent | 08504b5e0dd4ee87cc47d8a977d47466923bfc4b (diff) | |
| parent | c9493879d7b38b9d0b5b09aa3760966a3ca33eac (diff) | |
Merge changes from topic 'VectorDrawable polishing cherrypicks from master' into nyc-mr1-dev
* changes:
Support Keyframe definition for AVD on RT
Throw Exception for wrong valueType with API guard
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/animation/PropertyValuesHolder.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/animation/PropertyValuesHolder.java b/core/java/android/animation/PropertyValuesHolder.java index 1dee925f2bdd..ba16e673ea69 100644 --- a/core/java/android/animation/PropertyValuesHolder.java +++ b/core/java/android/animation/PropertyValuesHolder.java @@ -1095,8 +1095,12 @@ public class PropertyValuesHolder implements Cloneable { } // TODO: We need a better way to get data out of keyframes. if (mKeyframes instanceof PathKeyframes.FloatKeyframesBase - || mKeyframes instanceof PathKeyframes.IntKeyframesBase) { - // property values will animate based on external data source (e.g. Path) + || mKeyframes instanceof PathKeyframes.IntKeyframesBase + || (mKeyframes.getKeyframes() != null && mKeyframes.getKeyframes().size() > 2)) { + // When a pvh has more than 2 keyframes, that means there are intermediate values in + // addition to start/end values defined for animators. Another case where such + // intermediate values are defined is when animator has a path to animate along. In + // these cases, a data source is needed to capture these intermediate values. values.dataSource = new PropertyValues.DataSource() { @Override public Object getValueAtFraction(float fraction) { @@ -1108,6 +1112,13 @@ public class PropertyValuesHolder implements Cloneable { } } + /** + * @hide + */ + public Class getValueType() { + return mValueType; + } + @Override public String toString() { return mPropertyName + ": " + mKeyframes.toString(); |
