public class AnimatorValue extends Animator
This class is used to create animator sequence values. It is usually used for implementing a customized animator.
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static interface |
AnimatorValue.ValueUpdateListener |
Creates an update listener, which allows a notification to be received when a value animator is updated.
|
Animator.CurveType, Animator.LoopedListener, Animator.StateChangedListener, Animator.TimelineCurve| 限定符和类型 | 字段 | 说明 |
|---|---|---|
protected AnimatorValue.ValueUpdateListener |
mUpdateListener |
Indicates the callback invoked when updating a value animator.
|
INFINITE, mLoopedListener, mPauseListener, mStartListener| 构造器 | 说明 |
|---|---|
AnimatorValue() |
Default constructor used to create a value animator.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Object |
estimateFrameValue(float progress) |
estimate the value for specific name which has been defined when this object was created.
|
static AnimatorValue |
ofFloat(float... values) |
Creates a set of keyframes of type float
|
static AnimatorValue |
ofInt(int... values) |
Creates a set of keyframes of type int
|
static AnimatorValue |
ofKeyframe(TypeEstimator estimator,
Keyframe... values) |
Creates a set of keyframes of type values
|
static AnimatorValue |
ofObject(TypeEstimator estimator,
Object... values) |
Creates a set of keyframes of type values
|
void |
setCurve(Animator.TimelineCurve curve) |
Sets a timeline curve for this
AnimatorValue object to reflect the animation value changes. |
void |
setCurveType(int curveType) |
Sets the curve used by an animator, which is a linear interpolator by default.
|
void |
setDelay(long startDelay) |
Sets the startup delay of an animator.
|
void |
setDuration(long duration) |
Sets the duration of an animator.
|
boolean |
setEstimator(TypeEstimator estimator) |
Set the estimator type based on valueName.
|
void |
setLoopedCount(int loopedCount) |
Sets the repetition times of an animator.
|
void |
setLoopedListener(Animator.LoopedListener listener) |
Sets the repeat listener for animators.
|
void |
setStateChangedListener(Animator.StateChangedListener listener) |
Sets the state change listener for animators.
|
void |
setValueUpdateListener(AnimatorValue.ValueUpdateListener listener) |
Sets the update listener for animators.
|
cancel, end, getCurveType, getDelay, getDuration, getLoopedCount, isPaused, isRunning, pause, release, resume, setCurveInternal, setCurveTypeInternal, setDelayInternal, setDurationInternal, setLoopedCountInternal, setLoopedListenerInternal, setPauseListenerInternal, setStartListenerInternal, start, stopprotected AnimatorValue.ValueUpdateListener mUpdateListener
public static AnimatorValue ofInt(int... values)
values - One or a group of numbers of the int type.public static AnimatorValue ofFloat(float... values)
values - One or a group of numbers of the float type.public static AnimatorValue ofObject(TypeEstimator estimator, Object... values)
estimator - Examples of estimator types.values - One or a group of numbers of the Object values.public static AnimatorValue ofKeyframe(TypeEstimator estimator, Keyframe... values)
estimator - Examples of estimator types.values - One or a group of numbers of the Keyframe.public void setDuration(long duration)
duration - Specifies the duration of an animator.
The value must be greater than or equal to 0, in unit of milliseconds.public void setLoopedCount(int loopedCount)
loopedCount - Specifies the repetition times of an animator.
The value must be greater than or equal to 0, or INFINITE.
If the value is 0, the animator will be played only once.Animator.INFINITEpublic void setDelay(long startDelay)
startDelay - Specifies the startup delay of an animator.
The value must be greater than or equal to 0, in unit of milliseconds.public void setCurveType(int curveType)
curveType - Specifies the interpolator type for the animator.Animator.CurveTypepublic void setCurve(Animator.TimelineCurve curve)
AnimatorValue object to reflect the animation value changes.curve - Indicates the curve to set.Animator.TimelineCurvepublic void setStateChangedListener(Animator.StateChangedListener listener)
listener - Specifies the pause and resume listener for animators.
You can set it to null to clear the existing listener.public void setLoopedListener(Animator.LoopedListener listener)
listener - Specifies the repeat listener for animators.
You can set it to null to clear the existing listener.public void setValueUpdateListener(AnimatorValue.ValueUpdateListener listener)
listener - Specifies the update listener for animators.
You can set it to null to clear the existing listener.public boolean setEstimator(TypeEstimator estimator)
estimator - Type of estimator (customizable).public Object estimateFrameValue(float progress)
progress - current fraction