diff --git a/core/src/main/java/io/plaidapp/core/ui/recyclerview/SlideInItemAnimator.kt b/core/src/main/java/io/plaidapp/core/ui/recyclerview/SlideInItemAnimator.kt index 0111717be..cd9016657 100644 --- a/core/src/main/java/io/plaidapp/core/ui/recyclerview/SlideInItemAnimator.kt +++ b/core/src/main/java/io/plaidapp/core/ui/recyclerview/SlideInItemAnimator.kt @@ -26,6 +26,7 @@ import androidx.recyclerview.widget.DefaultItemAnimator import androidx.recyclerview.widget.RecyclerView import io.plaidapp.core.util.listenForAllSpringsEnd import io.plaidapp.core.util.spring +import java.util.concurrent.CopyOnWriteArrayList /** * A [RecyclerView.ItemAnimator] that fades & slides newly added items in from a given @@ -37,10 +38,10 @@ open class SlideInItemAnimator @JvmOverloads constructor( ) : DefaultItemAnimator() { private val slideFromEdge: Int = Gravity.getAbsoluteGravity(slideFromEdge, layoutDirection) - private val pendingAdds = mutableListOf() - private val runningAdds = mutableListOf() - private val pendingMoves = mutableListOf() - private val runningMoves = mutableListOf() + private val pendingAdds = CopyOnWriteArrayList() + private val runningAdds = CopyOnWriteArrayList() + private val pendingMoves = CopyOnWriteArrayList() + private val runningMoves = CopyOnWriteArrayList() @SuppressLint("RtlHardcoded") override fun animateAdd(holder: RecyclerView.ViewHolder): Boolean {