我做了这样的事情
val animator = ObjectAnimator.ofFloat(view, "translationY", 350f,0f)
animator.duration = 500
animator.startDelay=200
animator.interpolator =AccelerateDecelerateInterpolator()
animator.start()
现在,我正在尝试将侦听器添加到此适配器。我已经尝试过了,
animator.addListener(onStart = {view.visibility=View.VISIBLE})
但不起作用。
val animator = ObjectAnimator.ofFloat(view, "translationY", 350f, 0f)
animator.apply {
duration = 500
startDelay = 200
animator.addListener(onStart = {
view.visibility = View.VISIBLE
})
AccelerateDecelerateInterpolator()
start()
}