diff options
author | daneren2005 <daneren2005@gmail.com> | 2014-05-05 16:29:01 -0700 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2014-05-05 16:29:01 -0700 |
commit | 0158df319c9475fd3b8d1bd1c89aa775d0c3a90f (patch) | |
tree | 6317a2da55d82bc7f2398ab3cea9e26b1455a621 /src/github/daneren2005 | |
parent | fc43799ac928340d151086dd6885c4d5535fd42b (diff) | |
download | dsub-0158df319c9475fd3b8d1bd1c89aa775d0c3a90f.tar.gz dsub-0158df319c9475fd3b8d1bd1c89aa775d0c3a90f.tar.bz2 dsub-0158df319c9475fd3b8d1bd1c89aa775d0c3a90f.zip |
#343 Fix infinite adapter for largeAlbums = false
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 7e22eed1..17feb07e 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -659,8 +659,9 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
emptyView.setVisibility((entries.isEmpty() && albums.isEmpty()) ? View.VISIBLE : View.GONE);
+ // Always going to have entries in entryAdapter
entryAdapter = new EntryAdapter(context, getImageLoader(), entries, (podcastId == null));
- entryList.setAdapter(entryAdapter);
+ // Song-only genre needs to always be entry list + infinite adapter
if("genres-songs".equals(albumListType)) {
ViewGroup rootGroup = (ViewGroup) rootView.findViewById(R.id.select_album_layout);
if(rootGroup.findViewById(R.id.gridview) != null && largeAlbums) {
@@ -669,13 +670,18 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
entryList.setAdapter(new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize));
- } else if(largeAlbums) {
- if(albumListType == null || "starred".equals(albumListType)) {
- albumList.setAdapter(new AlbumGridAdapter(context, getImageLoader(), albums, !artist));
- } else {
+ } else if((albumListType == null || "starred".equals(albumListType)) && largeAlbums) {
+ // Only set standard album adapter if not album list and largeAlbums is true
+ albumList.setAdapter(new AlbumGridAdapter(context, getImageLoader(), albums, !artist));
+ } else {
+ // If album list, use infinite adapters for either depending on whether or not largeAlbums is true
+ if(largeAlbums) {
albumList.setAdapter(new AlbumListAdapter(context, new AlbumGridAdapter(context, getImageLoader(), albums, true), albumListType, albumListExtra, albumListSize));
+ } else {
+ entryAdapter = new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize);
}
}
+ entryList.setAdapter(entryAdapter);
entryList.setVisibility(View.VISIBLE);
context.supportInvalidateOptionsMenu();
|