aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-07-09 08:26:23 -0700
committerScott Jackson <daneren2005@gmail.com>2014-07-09 08:26:23 -0700
commit6a7aaafd33695307a2ac268642a967c1c9b45161 (patch)
tree89a22d1841fa7c08d278fdbc330174f9828958d4
parent35c3356f1b63457fc7072d60e8ba01e0aba3ec28 (diff)
downloaddsub-6a7aaafd33695307a2ac268642a967c1c9b45161.tar.gz
dsub-6a7aaafd33695307a2ac268642a967c1c9b45161.tar.bz2
dsub-6a7aaafd33695307a2ac268642a967c1c9b45161.zip
If no songs, use simple grid view to allow recycling
The UnscrollableGridView inflates every single view at the same time, which causes major performance issues on larger lists. IF there are no songs, just use the simple GridView which inflates and recycles them properly.
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index d40f8fad..aa8293f9 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -662,7 +662,16 @@ 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(addAlbumHeader) {
- entryList.addHeaderView(albumList);
+ if(showHeader) {
+ entryList.addHeaderView(albumList);
+ } else {
+ ViewGroup rootGroup = (ViewGroup) rootView.findViewById(R.id.select_album_layout);
+ albumList = (GridView) inflater.inflate(R.layout.grid_view, rootGroup, false);
+ rootGroup.removeView(entryList);
+ rootGroup.addView(albumList);
+
+ setupScrollList(albumList);
+ }
addAlbumHeader = false;
}