From cfde4425b7fb5f7e4abc02116f7e488b37f641ad Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Thu, 4 Jul 2024 15:34:44 -0300 Subject: [PATCH] fix(preview-quote-toots): make code nicer, and add the "IS_FOR_QUOTE" flag, so it works better --- .../fragments/BaseStatusListFragment.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 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 120e9fc3dc..54ac483334 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -722,12 +722,13 @@ public void onAddQuoteToStatus(Status status, Status parentStatus) { i++; } + int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS | StatusDisplayItem.FLAG_IS_FOR_QUOTE); + if (GlobalUserPreferences.spectatorMode) + flags |= StatusDisplayItem.FLAG_NO_FOOTER; + if (!GlobalUserPreferences.showMediaPreview) + flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW; + if (cardIndex!=-1) { - int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS); - if (GlobalUserPreferences.spectatorMode) - flags |= StatusDisplayItem.FLAG_NO_FOOTER; - if (!GlobalUserPreferences.showMediaPreview) - flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW; ArrayList items=StatusDisplayItem.buildItems(this, status, accountID, parentStatus, knownAccounts, null, flags); displayItems.remove(cardIndex); adapter.notifyItemRemoved(cardIndex); @@ -737,11 +738,6 @@ public void onAddQuoteToStatus(Status status, Status parentStatus) { } if (textIndex!=-1) { - int flags= (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS); - if (GlobalUserPreferences.spectatorMode) - flags |= StatusDisplayItem.FLAG_NO_FOOTER; - if (!GlobalUserPreferences.showMediaPreview) - flags |= StatusDisplayItem.FLAG_NO_MEDIA_PREVIEW; ArrayList items=StatusDisplayItem.buildItems(this, status, accountID, parentStatus, knownAccounts, null, flags); displayItems.addAll(textIndex+1, items); adapter.notifyItemRangeInserted(textIndex+1, items.size());