list: zero change-animation duration on swipeable lists instead

This commit is contained in:
jay
2026-11-12 16:44:06 -05:00
parent a251d5fc2d
commit 93c8f8f05f
2 changed files with 7 additions and 7 deletions
@@ -143,10 +143,10 @@ abstract class DetailFragment<P : MusicParent, C : Music> :
)
.attachToRecyclerView(binding.detailRecycler)
// Change animations cross-fade a rebound row, which reads as a flash when a committed
// swipe springs back. Keep add/remove/move animations.
binding.detailRecycler.itemAnimator =
DefaultItemAnimator().apply { supportsChangeAnimations = false }
// A committed swipe springs the row back via a rebind; a change cross-fade on that
// rebind reads as a flash. Zero the change duration instead of disabling change
// animations — the helper's recovery runs through the animator's change path.
binding.detailRecycler.itemAnimator = DefaultItemAnimator().apply { changeDuration = 0 }
spacingSmall = requireContext().getDimenPixels(R.dimen.spacing_small)
}
@@ -196,9 +196,9 @@ class SearchFragment : ListFragment<Music, FragmentSearchBinding>() {
)
.attachToRecyclerView(binding.searchRecycler)
// See DetailFragment: no change cross-fades, so a committed swipe doesn't flash.
binding.searchRecycler.itemAnimator =
DefaultItemAnimator().apply { supportsChangeAnimations = false }
// See DetailFragment: zero-duration change animations, so a committed swipe doesn't
// flash. (Disabling them outright breaks the helper's recovery.)
binding.searchRecycler.itemAnimator = DefaultItemAnimator().apply { changeDuration = 0 }
// --- VIEWMODEL SETUP ---