From fc3be2c41dad7671a2e6c0841accf881ca71c101 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sun, 10 Jan 2016 13:52:26 -0800 Subject: Fix now playing status with no track # (ie: Podcast) and go back to using same font color for track # --- .../java/github/daneren2005/dsub/view/SongView.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'app/src/main/java') 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 2bcef2b3..c7634b34 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java @@ -44,6 +44,7 @@ public class SongView extends UpdateView2 { private TextView trackTextView; private TextView titleTextView; + private TextView playingTextView; private TextView artistTextView; private TextView durationTextView; private TextView statusTextView; @@ -141,11 +142,23 @@ public class SongView extends UpdateView2 { String title = song.getTitle(); Integer track = song.getTrack(); + TextView newPlayingTextView; if(track != null && Util.getDisplayTrack(context)) { trackTextView.setText(String.format("%02d", track)); trackTextView.setVisibility(View.VISIBLE); + newPlayingTextView = trackTextView; } else { trackTextView.setVisibility(View.GONE); + newPlayingTextView = titleTextView; + } + + if(newPlayingTextView != playingTextView || playingTextView == null) { + if(playing) { + playingTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + playing = false; + } + + playingTextView = newPlayingTextView; } titleTextView.setText(title); @@ -252,12 +265,12 @@ public class SongView extends UpdateView2 { if (playing) { if(!this.playing) { this.playing = playing; - trackTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0); + playingTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0); } } else { if(this.playing) { this.playing = playing; - trackTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + playingTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); } } -- cgit v1.2.3