Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #842 #843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,10 +38,10 @@ open class SlideInItemAnimator @JvmOverloads constructor(
) : DefaultItemAnimator() {

private val slideFromEdge: Int = Gravity.getAbsoluteGravity(slideFromEdge, layoutDirection)
private val pendingAdds = mutableListOf<RecyclerView.ViewHolder>()
private val runningAdds = mutableListOf<RecyclerView.ViewHolder>()
private val pendingMoves = mutableListOf<RecyclerView.ViewHolder>()
private val runningMoves = mutableListOf<RecyclerView.ViewHolder>()
private val pendingAdds = CopyOnWriteArrayList<RecyclerView.ViewHolder>()
private val runningAdds = CopyOnWriteArrayList<RecyclerView.ViewHolder>()
private val pendingMoves = CopyOnWriteArrayList<RecyclerView.ViewHolder>()
private val runningMoves = CopyOnWriteArrayList<RecyclerView.ViewHolder>()

@SuppressLint("RtlHardcoded")
override fun animateAdd(holder: RecyclerView.ViewHolder): Boolean {
Expand Down