diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-05-03 17:17:23 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-05-03 17:17:23 -0700 |
commit | 7a067358df68d85e2439ec1d0155946e01116771 (patch) | |
tree | 3aabd1c6441f627266b0dcb1eb944ff134371b73 | |
parent | 23db3b989092525f0b5906bacf7456afc8eb1b52 (diff) | |
download | dsub-7a067358df68d85e2439ec1d0155946e01116771.tar.gz dsub-7a067358df68d85e2439ec1d0155946e01116771.tar.bz2 dsub-7a067358df68d85e2439ec1d0155946e01116771.zip |
Fix GB specific error
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 2edb38ac..d0cde823 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -150,7 +150,6 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter if(albumListType == null || "starred".equals(albumListType) || !largeAlbums) {
albumList = (GridView) inflater.inflate(R.layout.unscrollable_grid_view, entryList, false);
- entryList.addHeaderView(albumList);
} else {
ViewGroup rootGroup = (ViewGroup) rootView.findViewById(R.id.select_album_layout);
albumList = (GridView) inflater.inflate(R.layout.grid_view, rootGroup, false);
@@ -644,9 +643,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter if(showHeader) {
View header = createHeader(entries);
if(header != null && entryList != null) {
- entryList.removeHeaderView(albumList);
entryList.addHeaderView(header, null, false);
- entryList.addHeaderView(albumList);
}
}
} else {
@@ -656,6 +653,11 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter }
}
+ // Needs to be added here, GB crashes if you to try to remove the header view before adapter is set
+ if(albumListType == null || "starred".equals(albumListType) || !largeAlbums) {
+ entryList.addHeaderView(albumList);
+ }
+
emptyView.setVisibility((entries.isEmpty() && albums.isEmpty()) ? View.VISIBLE : View.GONE);
entryAdapter = new EntryAdapter(context, getImageLoader(), entries, (podcastId == null));
entryList.setAdapter(entryAdapter);
|