From 9b1e79eba8bd09626400d0f7f14eb7659f809c5a Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 7 Jul 2024 08:50:57 +0200 Subject: [PATCH] fix(StatusDisplayItem/Quote): notify adapter separately Only notifying the adapter once could lead to cases where the quoting status was merged with or replaced by the quote status. Separately notifying it seems to trigger the issue less often. --- .../joinmastodon/android/fragments/BaseStatusListFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 a0e4c08d5..e6af4d78b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -722,10 +722,11 @@ public abstract class BaseStatusListFragment exten assert (this instanceof StatusListFragment) || (this instanceof NotificationsListFragment); List items=this.buildDisplayItems((T) parent); displayItems.subList(startIndex, endIndex+1).clear(); + adapter.notifyItemRangeRemoved(startIndex, endIndex+1); boolean isEmpty=displayItems.isEmpty(); displayItems.addAll(startIndex, items); if(!isEmpty) - adapter.notifyItemRangeChanged(startIndex, items.size()); + adapter.notifyItemRangeInserted(startIndex, items.size()); } }