aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/SongView.java17
-rw-r--r--app/src/main/res/layout/song_list_item.xml4
2 files changed, 18 insertions, 3 deletions
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<MusicDirectory.Entry, Boolean> {
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<MusicDirectory.Entry, Boolean> {
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<MusicDirectory.Entry, Boolean> {
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);
}
}
diff --git a/app/src/main/res/layout/song_list_item.xml b/app/src/main/res/layout/song_list_item.xml
index ffd17e00..a81485de 100644
--- a/app/src/main/res/layout/song_list_item.xml
+++ b/app/src/main/res/layout/song_list_item.xml
@@ -23,8 +23,9 @@
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:textColorSecondary"
+ android:textColor="?android:textColorPrimary"
android:paddingLeft="6dip"
+ android:paddingRight="6dip"
android:drawablePadding="6dip"/>
<TextView
@@ -38,6 +39,7 @@
android:ellipsize="marquee"
android:paddingLeft="6dip"
android:paddingRight="6dip"
+ android:drawablePadding="6dip"
android:textColor="?android:textColorPrimary"/>
<ImageButton