Skip to content

Commit

Permalink
Merge pull request #374 from FineFindus/fix/show-filter-warning
Browse files Browse the repository at this point in the history
fix: replace correct filter item
  • Loading branch information
LucasGGamerM authored Apr 10, 2024
2 parents b0518b8 + 5ed4fdb commit 038923b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -763,12 +763,14 @@ public void onToggleExpanded(Status status, String itemID) {
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
Expand Down

0 comments on commit 038923b

Please sign in to comment.