aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-08-09 18:14:43 -0700
committerScott Jackson <daneren2005@gmail.com>2014-08-09 18:14:43 -0700
commitceba9812c87544529221dab8d1b97353f1122526 (patch)
tree6dc8dc8fc156fdaa06888945405434aa0507d5b0
parent6e56ad27c106e3fd79dbb93887dfc61ae37be762 (diff)
downloaddsub-ceba9812c87544529221dab8d1b97353f1122526.tar.gz
dsub-ceba9812c87544529221dab8d1b97353f1122526.tar.bz2
dsub-ceba9812c87544529221dab8d1b97353f1122526.zip
Fix an issue where the wrong index was removed from playlist
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index c26d7085..5ab22ae1 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -274,6 +274,7 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
addToPlaylist(getSelectedSongs());
return true;
case R.id.menu_remove_playlist:
+ // TODO: getSelected is returning offset
removeFromPlaylist(playlistId, playlistName, getSelectedIndexes());
return true;
case R.id.menu_download_all:
@@ -826,9 +827,10 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
List<Integer> indexes = new ArrayList<Integer>();
int count = entryList.getCount();
+ int headers = entryList.getHeaderViewsCount();
for (int i = 0; i < count; i++) {
if (entryList.isItemChecked(i)) {
- indexes.add(i - 1);
+ indexes.add(i - headers);
}
}