aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-11-03 08:49:05 -0800
committerScott Jackson <daneren2005@gmail.com>2015-11-03 08:49:05 -0800
commit183004516e23e777026c4a15ecc83d3613fcc216 (patch)
tree2bad06f19a76c321a7572095c657b95cc85e8817 /app/src/main/java
parentcdd0f0638df1fe5b8ded6b1be2b05af43f568a36 (diff)
downloaddsub-183004516e23e777026c4a15ecc83d3613fcc216.tar.gz
dsub-183004516e23e777026c4a15ecc83d3613fcc216.tar.bz2
dsub-183004516e23e777026c4a15ecc83d3613fcc216.zip
Fix errors trying to get bubble text for headers
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java7
-rw-r--r--app/src/main/java/github/daneren2005/dsub/adapter/PlaylistAdapter.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java
index 2eea0e74..5feaa482 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/ArtistAdapter.java
@@ -125,7 +125,12 @@ public class ArtistAdapter extends SectionAdapter<Artist> implements FastScrolle
@Override
public String getTextToShowInBubble(int position) {
- return getNameIndex(getItemForPosition(position).getName(), true);
+ Object item = getItemForPosition(position);
+ if(item instanceof Artist) {
+ return getNameIndex(((Artist) item).getName(), true);
+ } else {
+ return null;
+ }
}
public interface OnMusicFolderChanged {
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/PlaylistAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/PlaylistAdapter.java
index 7f7aacff..6402eecb 100644
--- a/app/src/main/java/github/daneren2005/dsub/adapter/PlaylistAdapter.java
+++ b/app/src/main/java/github/daneren2005/dsub/adapter/PlaylistAdapter.java
@@ -62,6 +62,11 @@ public class PlaylistAdapter extends SectionAdapter<Playlist> implements FastScr
@Override
public String getTextToShowInBubble(int position) {
- return getNameIndex(getItemForPosition(position).getName());
+ Object item = getItemForPosition(position);
+ if(item instanceof Playlist) {
+ return getNameIndex(((Playlist) item).getName());
+ } else {
+ return null;
+ }
}
}