diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-12-14 18:05:25 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-12-14 18:05:25 -0800 |
commit | 1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b (patch) | |
tree | 623e2ee057b69a352844ef149c0a167c5b54dc2b /app/src/main | |
parent | e22398a16d6c55f820fc8244b04dc868859435a6 (diff) | |
download | dsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.tar.gz dsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.tar.bz2 dsub-1eca3c26de2d6bc3cb3b55d44cec39c94a08ac3b.zip |
Sort artists on every view since second level artists are otherwise not sorted the same way
Diffstat (limited to 'app/src/main')
3 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java index 9f1a62f8..3df0a9a9 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -177,6 +177,7 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Artist> impleme String musicFolderId = Util.getSelectedMusicFolderId(context); Indexes indexes = musicService.getIndexes(musicFolderId, refresh, context, listener); + indexes.sortChildren(context); artists = new ArrayList<>(indexes.getShortcuts().size() + indexes.getArtists().size()); artists.addAll(indexes.getShortcuts()); artists.addAll(indexes.getArtists()); @@ -201,6 +202,9 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Artist> impleme root.setIndex("#"); artists.add(root); } + + Indexes indexes = new Indexes(0, artists, new ArrayList<Artist>()); + indexes.sortChildren(context); } return artists; diff --git a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java index b3dc4fea..256fd6df 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java @@ -526,8 +526,6 @@ public class CachedMusicService implements MusicService { public void save(ArrayList<Artist> objects) { if (changed) { indexes.setArtists(objects); - // Reapply sort after addition - indexes.sortChildren(context); FileUtil.serialize(context, indexes, cacheName); cachedIndexes.set(indexes); } diff --git a/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java index 11a723ce..b8633624 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/OfflineMusicService.java @@ -101,7 +101,6 @@ public class OfflineMusicService implements MusicService { } Indexes indexes = new Indexes(0L, Collections.<Artist>emptyList(), artists, entries); - indexes.sortChildren(context); return indexes; } |