1616import static it .niedermann .owncloud .notes .main .slots .SlotterUtil .fillListByInitials ;
1717import static it .niedermann .owncloud .notes .main .slots .SlotterUtil .fillListByTime ;
1818import static it .niedermann .owncloud .notes .shared .model .CategorySortingMethod .SORT_MODIFIED_DESC ;
19- import static it .niedermann .owncloud .notes .shared .model .CategorySortingMethod .SORT_LEXICOGRAPHICAL_ASC ;
19+ import static it .niedermann .owncloud .notes .shared .model .CategorySortingMethod .SORT_LEXICOGRAPHICAL_DESC ;
2020import static it .niedermann .owncloud .notes .shared .model .ENavigationCategoryType .DEFAULT_CATEGORY ;
2121import static it .niedermann .owncloud .notes .shared .model .ENavigationCategoryType .FAVORITES ;
2222import static it .niedermann .owncloud .notes .shared .model .ENavigationCategoryType .RECENT ;
@@ -273,6 +273,9 @@ public LiveData<List<Item>> getNotesListLiveData() {
273273 }
274274
275275 private List <Item > fromNotes (List <Note > noteList , @ NonNull NavigationCategory selectedCategory , @ Nullable CategorySortingMethod sortingMethod ) {
276+ if (sortingMethod == SORT_LEXICOGRAPHICAL_DESC ){
277+ Collections .reverse (noteList );
278+ }
276279 if (selectedCategory .getType () == DEFAULT_CATEGORY ) {
277280 final String category = selectedCategory .getCategory ();
278281 if (category != null ) {
@@ -284,9 +287,6 @@ private List<Item> fromNotes(List<Note> noteList, @NonNull NavigationCategory se
284287 if (sortingMethod == SORT_MODIFIED_DESC ) {
285288 return fillListByTime (getApplication (), noteList );
286289 }
287- if (sortingMethod != SORT_LEXICOGRAPHICAL_ASC ){
288- Collections .reverse (noteList );
289- }
290290 return fillListByInitials (getApplication (), noteList );
291291 }
292292
0 commit comments