mirror of
https://github.com/mastodon/mastodon-android.git
synced 2025-01-31 02:44:48 +01:00
Fix #820, probably
This commit is contained in:
parent
ea1216b352
commit
6e4590caf2
@ -651,6 +651,9 @@ public class UiUtils{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static <T> void updateList(List<T> oldList, List<T> newList, RecyclerView list, RecyclerView.Adapter<?> adapter, BiPredicate<T, T> areItemsSame){
|
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
|
// 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;
|
int topItem, topItemOffset;
|
||||||
if(list.getChildCount()==0){
|
if(list.getChildCount()==0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user