list: zero change-animation duration on swipeable lists instead
This commit is contained in:
@@ -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 ---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user