From 113b47d9e2dc3ebdb0003aa1799e8d9cff35427d Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Sat, 6 Jul 2024 20:50:40 -0300 Subject: [PATCH] refactor(preview-quote-toots): make the updateStatusWithQuote generic, and also readd the notification support The notification support is needed because of the post notifications, which would benefit from this --- .../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 ad08fb703..55e6a9883 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -706,12 +706,12 @@ public abstract class BaseStatusListFragment exten toggleSpoiler(status, isForQuote, holder.getItemID()); } - public void updateStatusWithQuote(Status status) { + public void updateStatusWithQuote(DisplayItemsParent parent) { int startIndex=-1; int endIndex=-1; for(int i=0; i exten if (startIndex!=-1 && endIndex!=-1) { //Only StatusListFragments can display Status/Quotes - assert this instanceof StatusListFragment; - List items=((StatusListFragment) this).buildDisplayItems(status); + assert (this instanceof StatusListFragment) || (this instanceof NotificationsListFragment); + List items=this.buildDisplayItems((T) parent); displayItems.subList(startIndex, endIndex+1).clear(); boolean isEmpty=displayItems.isEmpty(); displayItems.addAll(startIndex, items);