Reset search filter

This commit is contained in:
Clayton Wilson 2020-11-04 23:14:59 -05:00
parent dd7a823552
commit ad4e7fd810

View File

@ -377,6 +377,17 @@ public class SearchResults extends AppCompatActivity implements FilterDialogFrag
}
});
// Reset price filter
double max = 0;
for (int i = 0; i < resultsProductListSorted.size(); i++){
if (resultsProductListSorted.get(i).getPrice().doubleValue() > max) {
max = resultsProductListSorted.get(i).getPrice().doubleValue();
}
}
this.minPrice = 0;
this.maxPrice = max;
// Apply selected sorting to the list
sortResults();