From d61e417d7cb5abedeb36ad3ce507c2fb8ff2350b Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 10 Jan 2016 13:43:35 -0800 Subject: Update current playing to match on entry instead of just DownloadFile object --- .../java/github/daneren2005/dsub/service/DownloadFile.java | 13 +++++++++++++ .../main/java/github/daneren2005/dsub/view/SongView.java | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'app/src/main') 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 { 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 { rightImage = false; } - boolean playing = downloadService.getCurrentPlaying() == downloadFile; + boolean playing = Util.equals(downloadService.getCurrentPlaying(), downloadFile); if (playing) { if(!this.playing) { this.playing = playing; -- cgit v1.2.3