From 8520a4728644500ef25e3954e516d1c506c9afa7 Mon Sep 17 00:00:00 2001 From: inorichi Date: Mon, 18 Jan 2016 19:28:13 +0100 Subject: [PATCH] Sort sources alphabetically. Fix #31 --- .../java/eu/kanade/tachiyomi/data/source/SourceManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/SourceManager.java b/app/src/main/java/eu/kanade/tachiyomi/data/source/SourceManager.java index c4ef6969c..2a7d183f1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/SourceManager.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/SourceManager.java @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.data.source; import android.content.Context; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -59,7 +60,9 @@ public class SourceManager { } public List getSources() { - return new ArrayList<>(sourcesMap.values()); + List sources = new ArrayList<>(sourcesMap.values()); + Collections.sort(sources, (s1, s2) -> s1.getName().compareTo(s2.getName())); + return sources; } }