Merge pull request #374 from FineFindus/fix/show-filter-warning
fix: replace correct filter item
This commit is contained in:
commit
038923bf8f
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue