aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2014-05-07 14:18:15 -0700
committerdaneren2005 <daneren2005@gmail.com>2014-05-07 14:18:15 -0700
commit05bcbcd600f3907c67b54a4857449834becce3b1 (patch)
tree2aaab688195938009fd4007f06eba46299cbad80 /src
parentea7ef402109f2b86cb72894e147e55ad748d617e (diff)
downloaddsub-05bcbcd600f3907c67b54a4857449834becce3b1.tar.gz
dsub-05bcbcd600f3907c67b54a4857449834becce3b1.tar.bz2
dsub-05bcbcd600f3907c67b54a4857449834becce3b1.zip
Fix refreshing adding multiple instances of grid
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 086c0f7e..27f25fd2 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -64,6 +64,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
private List<MusicDirectory.Entry> albums;
private List<MusicDirectory.Entry> entries;
private boolean albumContext = false;
+ private boolean addAlbumHeader = false;
String id;
String name;
@@ -152,6 +153,7 @@ 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);
+ addAlbumHeader = true;
} else {
ViewGroup rootGroup = (ViewGroup) rootView.findViewById(R.id.select_album_layout);
albumList = (GridView) inflater.inflate(R.layout.grid_view, rootGroup, false);
@@ -656,8 +658,9 @@ 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) {
+ if(addAlbumHeader) {
entryList.addHeaderView(albumList);
+ addAlbumHeader = false;
}
emptyView.setVisibility((entries.isEmpty() && albums.isEmpty()) ? View.VISIBLE : View.GONE);