From 1829dc1d9d70beabfc35bafb106c48e1f143f5d5 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Wed, 17 Jul 2024 12:09:07 -0300 Subject: [PATCH] fix(unofficial-quotes): try to fix the sudden reload to the top (again) --- .../android/fragments/BaseStatusListFragment.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index fd50f77ac..168154ade 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -721,12 +721,12 @@ public abstract class BaseStatusListFragment exten // Only StatusListFragments/NotificationsListFragments can display status with quotes assert (this instanceof StatusListFragment) || (this instanceof NotificationsListFragment); List items=this.buildDisplayItems((T) parent); + int itemCount = displayItems.subList(startIndex, endIndex+1).size()-1; displayItems.subList(startIndex, endIndex+1).clear(); -// adapter.notifyItemRangeRemoved(startIndex, endIndex+1); - boolean isEmpty=displayItems.isEmpty(); + adapter.notifyItemRangeChanged(startIndex, itemCount); displayItems.addAll(startIndex, items); - if(!isEmpty) - adapter.notifyItemRangeInserted(startIndex, items.size()); + if(!displayItems.isEmpty()) + adapter.notifyItemRangeChanged(startIndex, items.size()-1); } }