DecelerateAnimator

class DecelerateAnimator @JvmOverloads() constructor(context: Context, mBounceCoeff: Float, isBouncing: Boolean) : ValueAnimator

减速动画,默认启用回弹效果。

Author

Simon Lee

Constructors

DecelerateAnimator
Link copied to clipboard
fun DecelerateAnimator(context: Context, bouncing: Boolean)
DecelerateAnimator
Link copied to clipboard
fun DecelerateAnimator(context: Context, mBounceCoeff: Float = 10f, isBouncing: Boolean = true)

Functions

getDistanceByDuration
Link copied to clipboard
fun getDistanceByDuration(duration: Long, frictionCoeff: Float = 1f): Float
根据时间计算位移距离,无方向性
getDistanceByVelocity
Link copied to clipboard
fun getDistanceByVelocity(velocity: Float, frictionCoeff: Float = 1f): Float
根据初速度计算位移
getDurationByDistance
Link copied to clipboard
fun getDurationByDistance(distance: Float, frictionCoeff: Float = 1f): Long
根据位移距离计算持续时间
getDurationByVelocity
Link copied to clipboard
fun getDurationByVelocity(velocity: Float, frictionCoeff: Float = 1f): Long
根据初速度计算持续时间
getVelocityByDistance
Link copied to clipboard
fun getVelocityByDistance(distance: Float, frictionCoeff: Float = 1f): Float
根据位移计算初速度
reviseDistance
Link copied to clipboard
fun reviseDistance(distance: Float, startValue: Float, modulus: Float): Float
校正位移,确保终点值是模的整数倍
setFlingFrictionRatio
Link copied to clipboard
fun setFlingFrictionRatio(ratio: Float)
设置动摩擦系数倍率
startAnimator
Link copied to clipboard
fun startAnimator(startValue: Float, finalValue: Float, maxDuration: Long)
指定位移距离和最大动画时间,开始减速动画。
fun startAnimator(startValue: Float, minFinalValue: Float, maxFinalValue: Float, velocity: Float)
指定起止值和初始速度,开始减速动画 终点值一定是极小值或者极大值
startAnimator_Distance
Link copied to clipboard
fun startAnimator_Distance(startValue: Float, distance: Float, modulus: Float)
指定位移距离,开始减速动画。 无边界
fun startAnimator_Distance(startValue: Float, minValue: Float, maxValue: Float, distance: Float, modulus: Float)
指定位移距离,开始减速动画。 当极大值大于极小值时有边界
startAnimator_Velocity
Link copied to clipboard
fun startAnimator_Velocity(startValue: Float, velocity: Float, modulus: Float)
指定初始速度,开始减速动画。 无边界
fun startAnimator_Velocity(startValue: Float, minValue: Float, maxValue: Float, velocity: Float, modulus: Float)
指定初始速度,开始减速动画。 当极大值大于极小值时有边界