Merge pull request #374 from FineFindus/fix/show-filter-warning

fix: replace correct filter item
This commit is contained in:
LucasGGamerM 2024-04-10 12:39:54 -03:00 committed by GitHub
commit 038923bf8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 onGapClick(GapStatusDisplayItem.Holder item, boolean downwards){}
public void onWarningClick(WarningFilteredStatusDisplayItem.Holder warning){ 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.remove(startPos);
displayItems.addAll(startPos, warning.filteredItems); displayItems.addAll(startPos, warning.filteredItems);
adapter.notifyItemRangeInserted(startPos, warning.filteredItems.size() - 1); adapter.notifyItemRangeInserted(startPos, warning.filteredItems.size() - 1);
if (startPos == 0) scrollToTop(); if (startPos == 0) scrollToTop();
warning.getItem().status.filterRevealed = true; warning.getItem().status.filterRevealed = true;
list.invalidateItemDecorations();
} }
@Override @Override