Slide 25
Slide 25 text
class Animator : SimpleItemAnimator() {
…
override fun animateMove(
holder: RecyclerView.ViewHolder,
fromX: Int,
fromY: Int,
toX: Int,
toY: Int
): Boolean {
holder.itemView.y = fromY.toFloat()
ViewCompat.animate(holder.itemView)
.y(toY.toFloat())
.setDuration(moveDuration)
.setInterpolator(DecelerateInterpolator())
.let(pendingAnimators::add)
return true
}
}
SimpleItemAnimator#animateMove