android.graphics.Interpolator
Nested Classes
Summary
Public Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
public
Interpolator(int valueCount)
public
Interpolator(int valueCount, int frameCount)
Public Methods
public
final
int
getKeyFrameCount()
public
final
int
getValueCount()
public
void
reset(int valueCount, int frameCount)
Reset the Interpolator to have the specified number of values and
keyFrames. After this call the values for each keyFrame must be assigned
using setKeyFrame().
public
void
reset(int valueCount)
Reset the Interpolator to have the specified number of values and an
implicit keyFrame count of 2 (just a start and end). After this call the
values for each keyFrame must be assigned using setKeyFrame().
public
void
setKeyFrame(int index, int msec, float[] values)
Assign the keyFrame (specified by index) a time value and an array of key
values (with an implicity blend array of [0, 0, 1, 1] giving linear
transition to the next set of key values).
Parameters
index
| The index of the key frame to assign |
msec
| The time (in mililiseconds) for this key frame. Based on the
SystemClock.uptimeMillis() clock |
values
| Array of values associated with theis key frame
|
public
void
setKeyFrame(int index, int msec, float[] values, float[] blend)
Assign the keyFrame (specified by index) a time value and an array of key
values and blend array.
Parameters
index
| The index of the key frame to assign |
msec
| The time (in mililiseconds) for this key frame. Based on the
SystemClock.uptimeMillis() clock |
values
| Array of values associated with theis key frame |
blend
| (may be null) Optional array of 4 blend values
|
public
void
setRepeatMirror(float repeatCount, boolean mirror)
Set a repeat count (which may be fractional) for the interpolator, and
whether the interpolator should mirror its repeats. The default settings
are repeatCount = 1, and mirror = false.
Calls timeToValues(msec, values) with the msec set to now (by calling
(int)SystemClock.uptimeMillis().)
public
Interpolator.Result
timeToValues(int msec, float[] values)
Given a millisecond time value (msec), return the interpolated values and
return whether the specified time was within the range of key times
(NORMAL), was before the first key time (FREEZE_START) or after the last
key time (FREEZE_END). In any event, computed values are always returned.
Parameters
msec
| The time (in milliseconds) used to sample into the
Interpolator. Based on the SystemClock.uptimeMillis() clock |
values
| Where to write the computed values (may be NULL). |
Returns
- how the values were computed (even if values == null)
Protected Methods
protected
void
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver. Subclasses can use this facility to guarantee
that any associated resources are cleaned up before the receiver is
garbage collected. Uncaught exceptions which are thrown during the
running of the method cause it to terminate immediately, but are
otherwise ignored.
Note: The virtual machine assumes that the implementation in class Object
is empty.