我正在从事一个kotlin项目,我试图将java中的一个方法转换为kotlin.
None of the following functions can be called with the arguments supplied.个
它发生在ObjectAnimator.ofFloat()
点
代码如下
Code
fun animate(holder: RecyclerView.ViewHolder, goesDown: Boolean) {
val animat = AnimatorSet()
val objectY = ObjectAnimator.ofFloat(holder.itemView, "translationY", if (goesDown) 200 else -200, 0)
objectY.setDuration(Kons.Duration.toLong())
val objectX = ObjectAnimator.ofFloat(holder.itemView, "translationX", -50, 50, -30, 30, -20, 20, -5, 5, 0)
objectX.setDuration(Kons.Duration.toLong())
animat.playTogether(objectX, objectY)
animat.start()
}