From 44d4eada514ccc4e72d18f2b132c0f2b5865f5d1 Mon Sep 17 00:00:00 2001 From: sk Date: Sat, 22 Apr 2023 20:14:07 +0200 Subject: [PATCH] fix "load missing more" being hidden closes sk22#482 --- .../ui/displayitems/StatusDisplayItem.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java index fcffebbe1..300f16185 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java @@ -201,8 +201,6 @@ public abstract class StatusDisplayItem{ } if(addFooter){ items.add(new FooterStatusDisplayItem(parentID, fragment, statusForContent, accountID)); - if(status.hasGapAfter && !(fragment instanceof ThreadFragment)) - items.add(new GapStatusDisplayItem(parentID, fragment)); } int i=1; for(StatusDisplayItem item:items){ @@ -210,13 +208,16 @@ public abstract class StatusDisplayItem{ item.index=i++; } - if (!statusForContent.filterRevealed) { - return new ArrayList<>(List.of( - new WarningFilteredStatusDisplayItem(parentID, fragment, statusForContent, items) - )); + ArrayList result = statusForContent.filterRevealed ? items : + new ArrayList<>(List.of(new WarningFilteredStatusDisplayItem(parentID, fragment, statusForContent, items))); + + if (addFooter && status.hasGapAfter && !(fragment instanceof ThreadFragment)) { + StatusDisplayItem gap = new GapStatusDisplayItem(parentID, fragment); + gap.index = i++; + result.add(gap); } - return items; + return result; } public static void buildPollItems(String parentID, BaseStatusListFragment fragment, Poll poll, List items){