Animator.TimelineCurvepublic class SpringCurve extends Object implements Animator.TimelineCurve
| 构造器 | 说明 |
|---|---|
SpringCurve() |
Default constructor used to create a
SpringCurve instance. |
SpringCurve(float stiffness,
float damping) |
A constructor used to create a
SpringCurve instance, by specifying the stiffness and damping of the
spring. |
SpringCurve(float stiffness,
float damping,
float endPos) |
A constructor used to create a
SpringCurve instance, by specifying the stiffness, damping, and end
position (rest position) of the spring. |
SpringCurve(float stiffness,
float damping,
float endPos,
float velocity) |
A constructor used to create a
SpringCurve instance, by specifying the stiffness, damping,
end position (rest position), and start velocity of the spring. |
SpringCurve(float stiffness,
float damping,
float endPos,
float velocity,
float valueThreshold) |
A constructor used to create a
SpringCurve instance, by specifying the stiffness, damping,
end position (rest position), start velocity, and displacement threshold of the spring. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
float |
getCurvedTime(float time) |
Obtains the curve value at the specified the normalized time.
|
long |
getDuration() |
Obtains the estimated duration of the spring movement.
|
public SpringCurve()
SpringCurve instance.public SpringCurve(float stiffness,
float damping)
SpringCurve instance, by specifying the stiffness and damping of the
spring.stiffness - Indicates the stiffness of the spring, which is greater than 0.damping - Indicates the damping of the spring, which is greater than 0.public SpringCurve(float stiffness,
float damping,
float endPos)
SpringCurve instance, by specifying the stiffness, damping, and end
position (rest position) of the spring.stiffness - Indicates the stiffness of the spring.damping - Indicates the damping of the spring.endPos - Indicates the end position (rest position) of the spring.public SpringCurve(float stiffness,
float damping,
float endPos,
float velocity)
SpringCurve instance, by specifying the stiffness, damping,
end position (rest position), and start velocity of the spring.stiffness - Indicates the stiffness of the spring.damping - Indicates the damping of the spring.endPos - Indicates the end position (rest position) of the spring.velocity - Indicates the start velocity of the spring.public SpringCurve(float stiffness,
float damping,
float endPos,
float velocity,
float valueThreshold)
SpringCurve instance, by specifying the stiffness, damping,
end position (rest position), start velocity, and displacement threshold of the spring.stiffness - Indicates the stiffness of the spring.damping - Indicates the damping of the spring.endPos - Indicates the end position (rest position) of the spring.velocity - Indicates the start velocity of the spring.valueThreshold - Indicates the displacement threshold of the spring.public long getDuration()
public float getCurvedTime(float time)
getCurvedTime 在接口中 Animator.TimelineCurvetime - Indicates the normalized time.1.0 if the curve value overshoots the target value; returns a value
lower than 0 if the curve value undershoots the target value.AnimatorProperty.setCurve(Animator.TimelineCurve curve),
AnimatorValue.setCurve(Animator.TimelineCurve curve),
AnimatorGroup.setCurve(Animator.TimelineCurve curve)