diff --git a/src/api-impl/android/animation/ObjectAnimator.java b/src/api-impl/android/animation/ObjectAnimator.java index 878a1188..0d4de497 100644 --- a/src/api-impl/android/animation/ObjectAnimator.java +++ b/src/api-impl/android/animation/ObjectAnimator.java @@ -320,6 +320,34 @@ public final class ObjectAnimator extends ValueAnimator { return anim; } + /** + * Constructs and returns an ObjectAnimator that animates coordinates along a Path + * using two properties. A Path animation moves in two dimensions, animating + * coordinates (x, y) together to follow the line. In this variation, the + * coordinates are floats that are set to separate properties designated by + * xPropertyName and yPropertyName. + * + * @param target The object whose properties are to be animated. This object should + * have public methods on it called setNameX() and + * setNameY, where nameX and nameY + * are the value of the xPropertyName and yPropertyName + * parameters, respectively. + * @param xPropertyName The name of the property for the x coordinate being animated. + * @param yPropertyName The name of the property for the y coordinate being animated. + * @param path The Path to animate values along. + * @return An ObjectAnimator object that is set up to animate along path. + */ + public static ObjectAnimator ofFloat(Object target, String xPropertyName, String yPropertyName, + Path path) { + // PathKeyframes keyframes = KeyframeSet.ofPath(path); + // PropertyValuesHolder x = PropertyValuesHolder.ofKeyframes(xPropertyName, + // keyframes.createXFloatKeyframes()); + // PropertyValuesHolder y = PropertyValuesHolder.ofKeyframes(yPropertyName, + // keyframes.createYFloatKeyframes()); + // return ofPropertyValuesHolder(target, x, y); + return new ObjectAnimator(); + } + /** * Constructs and returns an ObjectAnimator that animates between float values. A single * value implies that that value is the one being animated to, in which case the start value @@ -340,6 +368,30 @@ public final class ObjectAnimator extends ValueAnimator { return anim; } + /** + * Constructs and returns an ObjectAnimator that animates coordinates along a Path + * using two properties. A Path animation moves in two dimensions, animating + * coordinates (x, y) together to follow the line. In this variation, the + * coordinates are floats that are set to separate properties, xProperty and + * yProperty. + * + * @param target The object whose properties are to be animated. + * @param xProperty The property for the x coordinate being animated. + * @param yProperty The property for the y coordinate being animated. + * @param path The Path to animate values along. + * @return An ObjectAnimator object that is set up to animate along path. + */ + public static ObjectAnimator ofFloat(T target, Property xProperty, + Property yProperty, Path path) { + // PathKeyframes keyframes = KeyframeSet.ofPath(path); + // PropertyValuesHolder x = PropertyValuesHolder.ofKeyframes(xProperty, + // keyframes.createXFloatKeyframes()); + // PropertyValuesHolder y = PropertyValuesHolder.ofKeyframes(yProperty, + // keyframes.createYFloatKeyframes()); + // return ofPropertyValuesHolder(target, x, y); + return new ObjectAnimator(); + } + /** * Constructs and returns an ObjectAnimator that animates between Object values. A single * value implies that that value is the one being animated to, in which case the start value