mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-16 10:48:46 +00:00
Fix bug in search results sorting
This commit is contained in:
parent
4a1bab2001
commit
dd13995ffe
@ -165,6 +165,10 @@ public class SearchResults extends AppCompatActivity implements SortDialogFragme
|
|||||||
|
|
||||||
// Sorts the search results
|
// Sorts the search results
|
||||||
private void sortResults() {
|
private void sortResults() {
|
||||||
|
// Reset the filtered list
|
||||||
|
resultsProductListSorted.clear();
|
||||||
|
resultsProductListSorted.addAll(resultsProductList);
|
||||||
|
|
||||||
// Sort Modes
|
// Sort Modes
|
||||||
// 0 default (no sorting)
|
// 0 default (no sorting)
|
||||||
// 1 itemName
|
// 1 itemName
|
||||||
@ -175,8 +179,7 @@ public class SearchResults extends AppCompatActivity implements SortDialogFragme
|
|||||||
// Sort based on mode
|
// Sort based on mode
|
||||||
switch (this.sortMode) {
|
switch (this.sortMode) {
|
||||||
case 0:
|
case 0:
|
||||||
resultsProductListSorted.clear();
|
// Do nothing
|
||||||
resultsProductListSorted.addAll(resultsProductList);
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
resultsProductListSorted.sort(new Comparator<Product>() {
|
resultsProductListSorted.sort(new Comparator<Product>() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user