From a59c846034c8d51add774c5dcf52afd635bcd410 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 19 Jan 2015 16:49:42 -0800 Subject: #440 Hide folder selection if there is only a single one anyways --- src/github/daneren2005/dsub/fragments/SelectArtistFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java index d0ea96b3..6477f6cc 100644 --- a/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectArtistFragment.java @@ -174,6 +174,12 @@ public class SelectArtistFragment extends SelectListFragment { public List getObjects(MusicService musicService, boolean refresh, ProgressListener listener) throws Exception { if(!Util.isOffline(context) && !Util.isTagBrowsing(context)) { musicFolders = musicService.getMusicFolders(refresh, context, listener); + + // Hide folders option if there is only one + if(musicFolders.size() == 1) { + musicFolders = null; + Util.setSelectedMusicFolderId(context, null); + } } String musicFolderId = Util.getSelectedMusicFolderId(context); @@ -199,7 +205,7 @@ public class SelectArtistFragment extends SelectListFragment { folderButton = folderButtonParent.findViewById(R.id.select_artist_folder); } - if (Util.isOffline(context) || Util.isTagBrowsing(context)) { + if (Util.isOffline(context) || Util.isTagBrowsing(context) || musicFolders == null) { folderButton.setVisibility(View.GONE); } else { folderButton.setVisibility(View.VISIBLE); -- cgit v1.2.3