diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-01-19 16:49:42 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-01-19 16:49:42 -0800 |
commit | a59c846034c8d51add774c5dcf52afd635bcd410 (patch) | |
tree | 9fb536a56fd4c30dda29d9ad02c79851624070c1 /src/github | |
parent | 5104fa7fa27a82a29e53177424729072ab8dc219 (diff) | |
download | dsub-a59c846034c8d51add774c5dcf52afd635bcd410.tar.gz dsub-a59c846034c8d51add774c5dcf52afd635bcd410.tar.bz2 dsub-a59c846034c8d51add774c5dcf52afd635bcd410.zip |
#440 Hide folder selection if there is only a single one anyways
Diffstat (limited to 'src/github')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectArtistFragment.java | 8 |
1 files changed, 7 insertions, 1 deletions
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<Artist> { public List<Artist> 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<Artist> { 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);
|