Use Property for ofFloat with Path.
Bug 15827972
Change-Id: I8917f7ab0df9709c11ae38e89af6b603ec76d430
diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java
index 8947550..da56a77 100644
--- a/core/java/android/animation/ObjectAnimator.java
+++ b/core/java/android/animation/ObjectAnimator.java
@@ -469,7 +469,10 @@
*/
public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> xProperty,
Property<T, Float> yProperty, Path path) {
- return ofFloat(target, xProperty.getName(), yProperty.getName(), path);
+ Keyframe[][] keyframes = PropertyValuesHolder.createKeyframes(path, false);
+ PropertyValuesHolder x = PropertyValuesHolder.ofKeyframe(xProperty, keyframes[0]);
+ PropertyValuesHolder y = PropertyValuesHolder.ofKeyframe(yProperty, keyframes[1]);
+ return ofPropertyValuesHolder(target, x, y);
}
/**