recyclerView.itemExpandAnimator = ItemExpandAnimator.split() / scale() / none()
InboxRecyclerView
offers three kinds of animators for animating list items while the content is expanding, collapsing or being pulled.
By default, a duration of 350ms
and the FastOutSlowInInterpolator()
interpolator are used for item animations. This can be changed using,
pageLayout.animationDurationMillis = CUSTOM_DURATION
pageLayout.animationInterpolator = CUSTOM_INTERPOLATOR
Custom animations can be written by extending ItemExpandAnimator:
recyclerView.itemExpandAnimator = object : ItemExpandAnimator() {
override fun onPageMove(
recyclerView: InboxRecyclerView,
page: ExpandablePageLayout,
anchorViewOverlay: View?
) {
// This function gets called every time the page changes its position or size.
// You'll want to describe frames of your animation here by syncing the position
// of list items with the page. Avoid doing anything expensive, just like how
// you'd treat onDraw().
}
}