fix(compose-auto-complete): check if the animator is null before doing animations

Fixes #591 #564 #517 #434 #328
This commit is contained in:
LucasGGamerM
2025-04-30 11:46:22 -03:00
parent 8598dc2608
commit 0de346c1bc

View File

@@ -1008,6 +1008,9 @@ public class UiUtils {
}
public static <T> void updateList(List<T> oldList, List<T> newList, RecyclerView list, RecyclerView.Adapter<?> adapter, BiPredicate<T, T> areItemsSame) {
RecyclerView.ItemAnimator animator=list.getItemAnimator();
if(animator!=null)
animator.endAnimations();
// Save topmost item position and offset because for some reason RecyclerView would scroll the list to weird places when you insert items at the top
int topItem, topItemOffset;
if (list.getChildCount() == 0) {