fix: replace correct filter item

This commit is contained in:
FineFindus 2024-04-10 17:22:11 +02:00
parent 4f3d711d2b
commit 5ed4fdbb36
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B
1 changed files with 3 additions and 1 deletions

View File

@ -763,12 +763,14 @@ public abstract class BaseStatusListFragment<T extends DisplayItemsParent> exten
public void onGapClick(GapStatusDisplayItem.Holder item, boolean downwards){}
public void onWarningClick(WarningFilteredStatusDisplayItem.Holder warning){
int startPos = warning.getAbsoluteAdapterPosition();
WarningFilteredStatusDisplayItem filterItem=findItemOfType(warning.getItemID(), WarningFilteredStatusDisplayItem.class);
int startPos=displayItems.indexOf(filterItem);
displayItems.remove(startPos);
displayItems.addAll(startPos, warning.filteredItems);
adapter.notifyItemRangeInserted(startPos, warning.filteredItems.size() - 1);
if (startPos == 0) scrollToTop();
warning.getItem().status.filterRevealed = true;
list.invalidateItemDecorations();
}
@Override