diff options
Diffstat (limited to 'app/src/main/java/github/daneren2005')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/CardView.java | 2 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/SongView.java | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/view/CardView.java b/app/src/main/java/github/daneren2005/dsub/view/CardView.java index 973e63fa..7a38b13b 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/CardView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/CardView.java @@ -48,7 +48,7 @@ public class CardView extends FrameLayout{ setClipChildren(true); setBackgroundResource(R.drawable.card_rounded_corners); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - setElevation(10.0f); + setElevation(getResources().getInteger(R.integer.Card_Elevation)); } } } 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); } } |