Interpolator
open class Interpolator
kotlin.Any | |
↳ | android.graphics.Interpolator |
Summary
Nested classes | |
---|---|
Public constructors | |
---|---|
Interpolator(valueCount: Int) |
|
Interpolator(valueCount: Int, frameCount: Int) |
Public methods | |
---|---|
Int | |
Int | |
open Unit |
Reset the Interpolator to have the specified number of values and an implicit keyFrame count of 2 (just a start and end). |
open Unit |
Reset the Interpolator to have the specified number of values and keyFrames. |
open Unit |
setKeyFrame(index: Int, msec: Int, values: FloatArray!) Assign the keyFrame (specified by index) a time value and an array of key values (with an implicitly blend array of [0, 0, 1, 1] giving linear transition to the next set of key values). |
open Unit |
setKeyFrame(index: Int, msec: Int, values: FloatArray!, blend: FloatArray!) Assign the keyFrame (specified by index) a time value and an array of key values and blend array. |
open Unit |
setRepeatMirror(repeatCount: Float, mirror: Boolean) Set a repeat count (which may be fractional) for the interpolator, and whether the interpolator should mirror its repeats. |
open Interpolator.Result! |
timeToValues(values: FloatArray!) Calls timeToValues(msec, values) with the msec set to now (by calling (int)SystemClock. |
open Interpolator.Result! |
timeToValues(msec: Int, values: FloatArray!) 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). |
Protected methods | |
---|---|
open Unit |
finalize() |
Public constructors
Public methods
reset
open fun reset(valueCount: Int): Unit
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().
reset
open fun reset(
valueCount: Int,
frameCount: Int
): Unit
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().
setKeyFrame
open fun setKeyFrame(
index: Int,
msec: Int,
values: FloatArray!
): Unit
Assign the keyFrame (specified by index) a time value and an array of key values (with an implicitly blend array of [0, 0, 1, 1] giving linear transition to the next set of key values).
Parameters | |
---|---|
index |
Int: The index of the key frame to assign |
msec |
Int: The time (in mililiseconds) for this key frame. Based on the SystemClock.uptimeMillis() clock |
values |
FloatArray!: Array of values associated with theis key frame |
setKeyFrame
open fun setKeyFrame(
index: Int,
msec: Int,
values: FloatArray!,
blend: FloatArray!
): Unit
Assign the keyFrame (specified by index) a time value and an array of key values and blend array.
Parameters | |
---|---|
index |
Int: The index of the key frame to assign |
msec |
Int: The time (in mililiseconds) for this key frame. Based on the SystemClock.uptimeMillis() clock |
values |
FloatArray!: Array of values associated with theis key frame |
blend |
FloatArray!: (may be null) Optional array of 4 blend values |
setRepeatMirror
open fun setRepeatMirror(
repeatCount: Float,
mirror: Boolean
): Unit
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.
timeToValues
open fun timeToValues(values: FloatArray!): Interpolator.Result!
Calls timeToValues(msec, values) with the msec set to now (by calling (int)SystemClock.uptimeMillis().)
timeToValues
open fun timeToValues(
msec: Int,
values: FloatArray!
): Interpolator.Result!
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 |
Int: The time (in milliseconds) used to sample into the Interpolator. Based on the SystemClock.uptimeMillis() clock |
values |
FloatArray!: Where to write the computed values (may be NULL). |
Return | |
---|---|
Interpolator.Result! |
how the values were computed (even if values == null) |
Protected methods
finalize
protected open fun finalize(): Unit
Exceptions | |
---|---|
java.lang.Throwable |
the Exception raised by this method |