fix headers not filtered in notifications list
This commit is contained in:
parent
78225c482f
commit
df233eb1e2
|
@ -97,7 +97,7 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
|||
};
|
||||
HeaderStatusDisplayItem titleItem=extraText!=null ? new HeaderStatusDisplayItem(n.id, n.account, n.createdAt, this, accountID, n.status, extraText, n, null) : null;
|
||||
if(n.status!=null){
|
||||
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, titleItem!=null, titleItem==null, n, false, Filter.FilterContext.NOTIFICATIONS);
|
||||
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, titleItem!=null, titleItem==null, n, false, Filter.FilterContext.NOTIFICATIONS, titleItem);
|
||||
if(titleItem!=null){
|
||||
for(StatusDisplayItem item:items){
|
||||
if(item instanceof ImageStatusDisplayItem imgItem){
|
||||
|
@ -105,8 +105,6 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
|||
}
|
||||
}
|
||||
}
|
||||
if(titleItem!=null)
|
||||
items.add(0, titleItem);
|
||||
return items;
|
||||
}else if(titleItem!=null){
|
||||
AccountCardStatusDisplayItem card=new AccountCardStatusDisplayItem(n.id, this,
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.joinmastodon.android.utils.StatusFilterPredicate;
|
|||
import org.parceler.Parcels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
@ -98,6 +99,10 @@ public abstract class StatusDisplayItem{
|
|||
}
|
||||
|
||||
public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment<?> fragment, Status status, String accountID, DisplayItemsParent parentObject, Map<String, Account> knownAccounts, boolean inset, boolean addFooter, Notification notification, boolean disableTranslate, Filter.FilterContext filterContext){
|
||||
return buildItems(fragment, status, accountID, parentObject, knownAccounts, inset, addFooter, notification, disableTranslate, filterContext, null);
|
||||
}
|
||||
|
||||
public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment<?> fragment, Status status, String accountID, DisplayItemsParent parentObject, Map<String, Account> knownAccounts, boolean inset, boolean addFooter, Notification notification, boolean disableTranslate, Filter.FilterContext filterContext, StatusDisplayItem titleItem){
|
||||
String parentID=parentObject.getID();
|
||||
ArrayList<StatusDisplayItem> items=new ArrayList<>();
|
||||
|
||||
|
@ -191,6 +196,8 @@ public abstract class StatusDisplayItem{
|
|||
item.index=i++;
|
||||
}
|
||||
|
||||
if (titleItem != null) items.add(0, titleItem);
|
||||
|
||||
if (!statusForContent.filterRevealed) {
|
||||
return new ArrayList<>(List.of(
|
||||
new WarningFilteredStatusDisplayItem(parentID, fragment, statusForContent, items)
|
||||
|
|
Loading…
Reference in New Issue