mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-28 12:17:57 +03:00
ObjectAnimator: add back ofFloat() method stubs
We can't copy them from AOSP yet, because of missing class PathKeyframes
This commit is contained in:
parent
4f7b301c12
commit
9f94f9d668
1 changed files with 52 additions and 0 deletions
|
@ -320,6 +320,34 @@ public final class ObjectAnimator extends ValueAnimator {
|
|||
return anim;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs and returns an ObjectAnimator that animates coordinates along a <code>Path</code>
|
||||
* using two properties. A <code>Path</code></> animation moves in two dimensions, animating
|
||||
* coordinates <code>(x, y)</code> together to follow the line. In this variation, the
|
||||
* coordinates are floats that are set to separate properties designated by
|
||||
* <code>xPropertyName</code> and <code>yPropertyName</code>.
|
||||
*
|
||||
* @param target The object whose properties are to be animated. This object should
|
||||
* have public methods on it called <code>setNameX()</code> and
|
||||
* <code>setNameY</code>, where <code>nameX</code> and <code>nameY</code>
|
||||
* are the value of the <code>xPropertyName</code> and <code>yPropertyName</code>
|
||||
* 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 <code>Path</code> to animate values along.
|
||||
* @return An ObjectAnimator object that is set up to animate along <code>path</code>.
|
||||
*/
|
||||
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 <code>Path</code>
|
||||
* using two properties. A <code>Path</code></> animation moves in two dimensions, animating
|
||||
* coordinates <code>(x, y)</code> together to follow the line. In this variation, the
|
||||
* coordinates are floats that are set to separate properties, <code>xProperty</code> and
|
||||
* <code>yProperty</code>.
|
||||
*
|
||||
* @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 <code>Path</code> to animate values along.
|
||||
* @return An ObjectAnimator object that is set up to animate along <code>path</code>.
|
||||
*/
|
||||
public static <T> ObjectAnimator ofFloat(T target, Property<T, Float> xProperty,
|
||||
Property<T, Float> 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue