diff options
author | daneren2005 <daneren2005@gmail.com> | 2013-11-12 16:35:27 -0800 |
---|---|---|
committer | daneren2005 <daneren2005@gmail.com> | 2013-11-12 16:35:27 -0800 |
commit | 48b6a05198889ac4a3f594c4715cb83d1a58d3a7 (patch) | |
tree | 2081570c23e4d9c41ac7e7fa1bcb39838c4b7616 /src/github/daneren2005 | |
parent | 65a3d4a4dcfe870990ad146aca860e99b94f0624 (diff) | |
download | dsub-48b6a05198889ac4a3f594c4715cb83d1a58d3a7.tar.gz dsub-48b6a05198889ac4a3f594c4715cb83d1a58d3a7.tar.bz2 dsub-48b6a05198889ac4a3f594c4715cb83d1a58d3a7.zip |
Add position to bookmark view
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r-- | src/github/daneren2005/dsub/view/BookmarkAdapter.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/view/BookmarkAdapter.java b/src/github/daneren2005/dsub/view/BookmarkAdapter.java index 2ee8a31d..2ea7bf73 100644 --- a/src/github/daneren2005/dsub/view/BookmarkAdapter.java +++ b/src/github/daneren2005/dsub/view/BookmarkAdapter.java @@ -38,7 +38,8 @@ public class BookmarkAdapter extends ArrayAdapter<Bookmark> { } public View getView(int position, View convertView, ViewGroup parent) { - MusicDirectory.Entry entry = getItem(position).getEntry(); + Bookmark bookmark = getItem(position); + MusicDirectory.Entry entry = bookmark.getEntry(); SongView view; if (convertView != null) { view = (SongView) convertView; @@ -46,6 +47,12 @@ public class BookmarkAdapter extends ArrayAdapter<Bookmark> { view = new SongView(activity); } view.setObject(entry, false); + + // Add current position to duration + TextView durationTextView = (TextView) view.findViewById(R.id.song_duration); + String duration = durationTextView.getText().toString(); + durationTextView.setText(Util.formatDuration(bookmark.getPosition()) + " / " + duration); + return view; } } |