aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github/daneren2005/dsub/view/SongView.java
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-12-26 14:53:21 -0800
committerScott Jackson <daneren2005@gmail.com>2015-12-26 14:53:21 -0800
commitb04edc61886a4ab198f0d4c22c4f06e989fb973a (patch)
tree3721bb0947c00e3e0308bf6cafe02ee6510ca523 /app/src/main/java/github/daneren2005/dsub/view/SongView.java
parent020cb0854cb1325fc6b2ec72ed0cbd4bdaac01d4 (diff)
downloaddsub-b04edc61886a4ab198f0d4c22c4f06e989fb973a.tar.gz
dsub-b04edc61886a4ab198f0d4c22c4f06e989fb973a.tar.bz2
dsub-b04edc61886a4ab198f0d4c22c4f06e989fb973a.zip
#608 Add a color/spacing difference between Track # and title
Diffstat (limited to 'app/src/main/java/github/daneren2005/dsub/view/SongView.java')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/view/SongView.java11
1 files changed, 8 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 625303b7..13620715 100644
--- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java
+++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java
@@ -41,6 +41,7 @@ import java.io.File;
public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
private static final String TAG = SongView.class.getSimpleName();
+ private TextView trackTextView;
private TextView titleTextView;
private TextView artistTextView;
private TextView durationTextView;
@@ -70,6 +71,7 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
super(context);
LayoutInflater.from(context).inflate(R.layout.song_list_item, this, true);
+ trackTextView = (TextView) findViewById(R.id.song_track);
titleTextView = (TextView) findViewById(R.id.song_title);
artistTextView = (TextView) findViewById(R.id.song_artist);
durationTextView = (TextView) findViewById(R.id.song_duration);
@@ -139,7 +141,10 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
String title = song.getTitle();
Integer track = song.getTrack();
if(track != null && Util.getDisplayTrack(context)) {
- title = String.format("%02d", track) + " " + title;
+ trackTextView.setText(String.format("%02d", track));
+ trackTextView.setVisibility(View.VISIBLE);
+ } else {
+ trackTextView.setVisibility(View.GONE);
}
titleTextView.setText(title);
@@ -246,12 +251,12 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> {
if (playing) {
if(!this.playing) {
this.playing = playing;
- titleTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0);
+ trackTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0);
}
} else {
if(this.playing) {
this.playing = playing;
- titleTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
+ trackTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
}
}