diff options
author | Scott Jackson <daneren2005@gmail.com> | 2016-01-10 13:43:35 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2016-01-10 13:43:35 -0800 |
commit | d61e417d7cb5abedeb36ad3ce507c2fb8ff2350b (patch) | |
tree | 944b4c510a81dbf1f2fc162e7ddd825c7243a0ac /app/src/main | |
parent | a80a31f2f8790f0d24357dd356da469fea271aaf (diff) | |
download | dsub-d61e417d7cb5abedeb36ad3ce507c2fb8ff2350b.tar.gz dsub-d61e417d7cb5abedeb36ad3ce507c2fb8ff2350b.tar.bz2 dsub-d61e417d7cb5abedeb36ad3ce507c2fb8ff2350b.zip |
Update current playing to match on entry instead of just DownloadFile object
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java | 13 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/SongView.java | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java index 3febfaea..ac8b44d6 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadFile.java @@ -379,6 +379,19 @@ public class DownloadFile implements BufferFile { return "DownloadFile (" + song + ")"; } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DownloadFile downloadFile = (DownloadFile) o; + return Util.equals(this.getSong(), downloadFile.getSong()); + } + private class DownloadTask extends SilentBackgroundTask<Void> { private MusicService musicService; diff --git a/app/src/main/java/github/daneren2005/dsub/view/SongView.java b/app/src/main/java/github/daneren2005/dsub/view/SongView.java index 13620715..2bcef2b3 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java @@ -20,6 +20,7 @@ package github.daneren2005.dsub.view; import android.content.Context; import android.graphics.Color; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.*; @@ -247,7 +248,7 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> { rightImage = false; } - boolean playing = downloadService.getCurrentPlaying() == downloadFile; + boolean playing = Util.equals(downloadService.getCurrentPlaying(), downloadFile); if (playing) { if(!this.playing) { this.playing = playing; |