aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-05-05 18:17:42 -0700
committerScott Jackson <daneren2005@gmail.com>2014-05-05 18:17:42 -0700
commitd080dcaef9bb8377bc882e0b5e750cf315cbc321 (patch)
treeed2d94c62d74866f6c5f1aa69102424e35d14051 /src
parent0158df319c9475fd3b8d1bd1c89aa775d0c3a90f (diff)
downloaddsub-d080dcaef9bb8377bc882e0b5e750cf315cbc321.tar.gz
dsub-d080dcaef9bb8377bc882e0b5e750cf315cbc321.tar.bz2
dsub-d080dcaef9bb8377bc882e0b5e750cf315cbc321.zip
#343 Correct fix for infinite scroller
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 17feb07e..e9483de6 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -16,9 +16,11 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
+import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView;
+import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import github.daneren2005.dsub.R;
@@ -661,6 +663,7 @@ 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));
+ ListAdapter listAdapter = 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);
@@ -669,7 +672,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
rootGroup.addView(entryList);
}
- entryList.setAdapter(new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize));
+ listAdapter = new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize);
} 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));
@@ -678,10 +681,10 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
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);
+ listAdapter = new AlbumListAdapter(context, entryAdapter, albumListType, albumListExtra, albumListSize);
}
}
- entryList.setAdapter(entryAdapter);
+ entryList.setAdapter(listAdapter);
entryList.setVisibility(View.VISIBLE);
context.supportInvalidateOptionsMenu();