From 6e4590caf21c4ced52430a52427bc865ad205cff Mon Sep 17 00:00:00 2001 From: Grishka Date: Tue, 12 Nov 2024 22:40:48 +0300 Subject: [PATCH] Fix #820, probably --- .../main/java/org/joinmastodon/android/ui/utils/UiUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index 13bcb2a3d..f6e83f8d3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -651,6 +651,9 @@ public class UiUtils{ } public static void updateList(List oldList, List newList, RecyclerView list, RecyclerView.Adapter adapter, BiPredicate 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){