Skip to content
This repository was archived by the owner on Jun 5, 2022. It is now read-only.

Commit 0128d03

Browse files
committed
Make non-A-Z watcher sort options sort descending instead of ascending
- To better match expectations, when using a sorting option for start/stop checking or first showing, results should be sorted in a descending order since the user likely wants to find a recent watcher.
1 parent 4cd3cd2 commit 0128d03

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/src/main/java/nl/jpelgrm/movienotifier/ui/WatchersFragment.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,18 @@ && getContext() != null
302302
} else {
303303
Comparator<Watcher> comparator;
304304
switch(sort) {
305+
case 1: // Begin (start checking)
306+
comparator = (w1, w2) -> Long.compare(w2.getBegin(), w1.getBegin());
307+
break;
305308
case 2: // End (stop checking)
306-
comparator = (w1, w2) -> Long.compare(w1.getEnd(), w2.getEnd());
309+
comparator = (w1, w2) -> Long.compare(w2.getEnd(), w1.getEnd());
307310
break;
308311
case 3: // Start after (first showing)
309-
comparator = (w1, w2) -> Long.compare(w1.getFilters().getStartAfter(), w2.getFilters().getStartAfter());
312+
comparator = (w1, w2) -> Long.compare(w2.getFilters().getStartAfter(), w1.getFilters().getStartAfter());
310313
break;
311314
case 4: // A-Z
312-
comparator = sortAZ;
313-
break;
314-
case 1: // Begin (start checking)
315315
default:
316-
comparator = (w1, w2) -> Long.compare(w1.getBegin(), w2.getBegin());
316+
comparator = sortAZ;
317317
break;
318318
}
319319
Collections.sort(watchersSorted, comparator);

0 commit comments

Comments
 (0)