From e86905e4c853b4caf9a1abfeafd30534f281fc4e Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 5 Mar 2021 12:56:23 +0100 Subject: [PATCH] Sort folders to the end --- .../java/de/danoeh/antennapod/core/storage/DBReader.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index e45d53af3..96e418ef6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -891,12 +891,15 @@ public final class DBReader { } else { folder = new NavDrawerData.FolderDrawerItem(tag); folders.put(tag, folder); - items.add(folder); } drawerItem.id |= folder.id; folder.children.add(drawerItem); } } + List foldersSorted = new ArrayList<>(folders.values()); + Collections.sort(foldersSorted, (o1, o2) -> o1.getTitle().compareToIgnoreCase(o2.getTitle())); + items.addAll(foldersSorted); + NavDrawerData result = new NavDrawerData(items, queueSize, numNewItems, numDownloadedItems, feedCounters, UserPreferences.getEpisodeCleanupAlgorithm().getReclaimableItems()); adapter.close();