From b04edc61886a4ab198f0d4c22c4f06e989fb973a Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 26 Dec 2015 14:53:21 -0800 Subject: #608 Add a color/spacing difference between Track # and title --- app/src/main/java/github/daneren2005/dsub/view/SongView.java | 11 ++++++++--- app/src/main/res/layout/song_list_item.xml | 11 ++++++++++- 2 files changed, 18 insertions(+), 4 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 { 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 { 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 { 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 { 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); } } diff --git a/app/src/main/res/layout/song_list_item.xml b/app/src/main/res/layout/song_list_item.xml index 6bf025b8..30b86d3b 100644 --- a/app/src/main/res/layout/song_list_item.xml +++ b/app/src/main/res/layout/song_list_item.xml @@ -17,6 +17,16 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical"> + + -- cgit v1.2.3