plaid
plaid copied to clipboard
ConcurrentModificationException when ending animation
https://github.com/android/plaid/blob/1115fb60bbc870f296efe50471ad4746873f199e/core/src/main/java/io/plaidapp/core/ui/recyclerview/SlideInItemAnimator.kt#L183
In the endAnimations
method, while in a for each loop, the function remove is called on a MutableList<RecyclerView.ViewHolder>
which results in a ConcurrentModificationException :(
Substituting the forEach
with the following resolves the issue:
private inline fun <T> Iterable<T>.modifiableForEach(action: (T) -> Unit) {
iterator().apply {
while (hasNext()) next().apply(action)
}
}