From 63094436b033fcfc104d712cf78cede0380f64e0 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sun, 1 Nov 2015 14:58:19 +0100 Subject: [PATCH] Order feeds case-insensitive --- .../java/de/danoeh/antennapod/core/storage/DBReader.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 7a8609b04..c0a4bcf69 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 @@ -950,10 +950,15 @@ public final class DBReader { }; } else if(feedOrder == UserPreferences.FEED_ORDER_ALPHABETICAL) { comparator = (lhs, rhs) -> { - if(lhs.getTitle() == null) { + String t1 = lhs.getTitle(); + String t2 = rhs.getTitle(); + if(t1 == null) { return 1; + } else if(t2 == null) { + return -1; + } else { + return t1.toLowerCase().compareTo(t2.toLowerCase()); } - return lhs.getTitle().compareTo(rhs.getTitle()); }; } else { comparator = (lhs, rhs) -> {