我认为问题的标题说明了一切,
我想添加一个动画监听器,但无法得到我想要的结果。
//lottie_toggle is the view id
lottie_toggle.addAnimatorUpdateListener {valueAnimator->
val progress = (valueAnimator.animatedValue as Float * 100).toInt()
if (progress==100 ){
lottie_toggle.cancelAnimation()
lottie_toggle.progress=0f
}
if (progress==50 ){
lottie_toggle.cancelAnimation()
lottie_toggle.progress=0.5f
}
}发布于 2019-10-13 16:04:48
似乎设置最小/最大帧是一种合适的方式,
//if the animation has 60 frames
lottie_toggle.setMinAndMaxFrame(0,30) //to play the first half
lottie_toggle.setMinAndMaxFrame(30,60) //to play the second halfhttps://stackoverflow.com/questions/58358991
复制相似问题