转载,该博客写的比较简单明了了,记录一下
binding.sendRoot.apply {
val transitioner = LayoutTransition()
transitioner.setAnimator(
LayoutTransition.APPEARING, ObjectAnimator.ofFloat(
null, "translationX", -126.dpf, 0f
).setDuration(250)
)
transitioner.setAnimator(
LayoutTransition.DISAPPEARING, ObjectAnimator.ofFloat(
null, "translationX", 0f, (-126).dpf
).setDuration(250)
)
transitioner.setStagger(LayoutTransition.CHANGE_APPEARING, 250)
transitioner.setStagger(LayoutTransition.CHANGE_DISAPPEARING, 250)
transitioner.setStagger(LayoutTransition.CHANGING, 250)
layoutTransition = transitioner
}
网友评论